[OpenSIPS-Users] Ratelimit usage

Adrien LACOMME adrien.lacomme at appliwave.com
Fri Oct 27 15:06:26 UTC 2023


I'm trying to implement CPS limitation on OpenSIPS and I got some difficulties to understand how ratelimit module works.

Here is the setup (I want to limit cps to 1) :

if (!rl_check("test1", 1, "RED")) {
      send_reply(487, "Request Terminated: CPS limit exceeded");

I tried to make few calls simultaneously but rl_check return is always FALSE.

Here is the log I got :

2023-10-27T16:52:19.792337 SBC /usr/sbin/opensips[137782]: DBG:ratelimit:w_rl_check: Pipe test1 counter:1 load:0 limit:1 should NOT be blocked (0x7fcae1504888)
2023-10-27T16:52:19.804064 SBC /usr/sbin/opensips[137781]: DBG:ratelimit:w_rl_check: Pipe test1 counter:2 load:0 limit:1 should NOT be blocked (0x7fcae1504888)
2023-10-27T16:52:22.872991 SBC /usr/sbin/opensips[137782]: DBG:ratelimit:w_rl_check: Pipe test1 counter:3 load:0 limit:1 should NOT be blocked (0x7fcae1504888)
2023-10-27T16:52:22.918123 SBC /usr/sbin/opensips[137781]: DBG:ratelimit:w_rl_check: Pipe test1 counter:4 load:0 limit:1 should NOT be blocked (0x7fcae1504888)

Shouldn't the module block calls when the counter goes to 2 ? Or is he checking the load value to block ? If yes, why the load value isn't incremented ?



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20231027/777ad050/attachment.html>

More information about the Users mailing list