[OpenSIPS-Users] New usage for the ratelimit rl_check function

Răzvan Crainea razvan at opensips.org
Tue Jul 2 11:14:12 CEST 2013

Hi, Ximena!

If that's the desired behavior, then you are not using the proper 
rate-limiting algorithm. According to the documentation[1]:
"At the start of each interval an internal counter is reset and 
incremented for each incoming message."

I think you are looking for the RED algorithm[2], which considers the 
average load on the previous period.

[1] http://www.opensips.org/html/docs/modules/1.9.x/ratelimit.html#id249276
[2] http://www.opensips.org/html/docs/modules/1.9.x/ratelimit.html#id249295

Best regards,

Razvan Crainea
OpenSIPS Core Developer

On 07/02/2013 03:47 AM, xvelasco wrote:
> Hi Razvan,
> I have implemented the ratelimit module using the examples you gave to me.
> So, now the cps limit per gateway is being created/updated at runtime and
> I'm using TAILDROP as the default algorithm. Besides the timer_interval is
> set to 1.
> However, I have a new issue now. For example, I have a gateway "gw_0" that
> has a ratelimit set to 100. I'm generating 130 calls per second, that need
> to be processed using gw_0, the call duration for each call is 2 seconds.
> Once that limit is reached, the opensips should say: /Pipe gw_0 counter:101
> load:0 limit:100 should be blocked/. This is the expected behavior.
> But the thing is that every second the ratelimit per gateway is reseted,
> /DBG:ratelimit:rl_timer: Pipe "gw_0" load updated to 0/, and the counter for
> an specific gateway starts again at 0. This produces, for example, that when
> opensips is processing let's say the call 50 and it resets the ratelimit for
> gw_0, the counter for that gateway is now 0 and the remaining 80 calls will
> be successfully processed, due the gateway limit is 100. This behavior is
> not what I'm expecting, since at the same second the gateway will be
> processing more calls than the CPS we set.
> Am I missunderstanding the ratelimit module behavior?
> Thanks for your help!
> --
> View this message in context: http://opensips-open-sip-server.1449251.n2.nabble.com/New-usage-for-the-ratelimit-rl-check-function-tp7586630p7587028.html
> Sent from the OpenSIPS - Users mailing list archive at Nabble.com.
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users

More information about the Users mailing list