ratelimit (cps/timer_interval)

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

ratelimit (cps/timer_interval)

Max Mühlbronner-2

Hi,


just a small question regarding the ratelimit module. I am confused by the documentation:


rl_check():


"Note that the limit should be specified as per-second, not per-timer_interval."



But at the timer_interval modparam it says:


"All amounts of messages have to be divided by this timer to get a messages per second value. "




So which one is true, e.g. if i want to limit to 50 cps (and the default timer_interval is 10 seconds) would i just do something like:


if (!rl_check("$avp(carriername)", "50", "RED")) {
...


Or


if (!rl_check("$avp(carriername)", "500", "RED")) {





Thanks.


BR


Max Mühlbronner
------
42com Telecommunication GmbH
Straße der Pariser Kommune 12-16
10243 Berlin

Fon: +49-(0)30-2434299-28
Fax: +49-(0)30-2434299-99
E-Mail: [hidden email]
Web: 
www.42com.com


Firmenangaben/Company information:
Handelsregister/Commercial register: Amtsgericht Berlin HRB 99071 B
Umsatzsteuer-ID/VAT-ID: DE223812306
Geschäftsführer/CEO: Thomas Reinig, Alexander Reinig

Diese E-Mail enthält Informationen von 42com Telecommunication GmbH. Diese sind möglicherweise vertraulich und ausschließlich für den Adressaten bestimmt. Sollten Sie diese elektronische Nachricht irrtümlicherweise erhalten haben, so informieren Sie uns bitte unverzüglich telefonisch oder per E-Mail.

This message is intended only for the use of the individual or entity to which it is addressed. If you have received this message by mistake, please notify us immediately.


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: ratelimit (cps/timer_interval)

Razvan Crainea-3
Hello, Max!

If you want to limit to 50 CPS, you should use:
if (!rl_check("$avp(carriername)", "50", "RED"))

I will update the docs to reflect this.

Best regards,
Răzvan Crainea
OpenSIPS Solutions
www.opensips-solutions.com
On 06/07/2017 01:07 PM, Max Mühlbronner wrote:

Hi,


just a small question regarding the ratelimit module. I am confused by the documentation:


rl_check():


"Note that the limit should be specified as per-second, not per-timer_interval."



But at the timer_interval modparam it says:


"All amounts of messages have to be divided by this timer to get a messages per second value. "




So which one is true, e.g. if i want to limit to 50 cps (and the default timer_interval is 10 seconds) would i just do something like:


if (!rl_check("$avp(carriername)", "50", "RED")) {
...


Or


if (!rl_check("$avp(carriername)", "500", "RED")) {





Thanks.


BR


Max Mühlbronner
------
42com Telecommunication GmbH
Straße der Pariser Kommune 12-16
10243 Berlin

Fon: +49-(0)30-2434299-28
Fax: +49-(0)30-2434299-99
E-Mail: [hidden email]
Web: 
www.42com.com


Firmenangaben/Company information:
Handelsregister/Commercial register: Amtsgericht Berlin HRB 99071 B
Umsatzsteuer-ID/VAT-ID: DE223812306
Geschäftsführer/CEO: Thomas Reinig, Alexander Reinig

Diese E-Mail enthält Informationen von 42com Telecommunication GmbH. Diese sind möglicherweise vertraulich und ausschließlich für den Adressaten bestimmt. Sollten Sie diese elektronische Nachricht irrtümlicherweise erhalten haben, so informieren Sie uns bitte unverzüglich telefonisch oder per E-Mail.

This message is intended only for the use of the individual or entity to which it is addressed. If you have received this message by mistake, please notify us immediately.



_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: ratelimit (cps/timer_interval)

Max Mühlbronner-2

Cool, thanks.



BR


Max Mühlbronner
------
42com Telecommunication GmbH
Straße der Pariser Kommune 12-16
10243 Berlin

Fon: +49-(0)30-2434299-28
Fax: +49-(0)30-2434299-99
E-Mail: [hidden email]
Web: 
www.42com.com


Firmenangaben/Company information:
Handelsregister/Commercial register: Amtsgericht Berlin HRB 99071 B
Umsatzsteuer-ID/VAT-ID: DE223812306
Geschäftsführer/CEO: Thomas Reinig, Alexander Reinig

Diese E-Mail enthält Informationen von 42com Telecommunication GmbH. Diese sind möglicherweise vertraulich und ausschließlich für den Adressaten bestimmt. Sollten Sie diese elektronische Nachricht irrtümlicherweise erhalten haben, so informieren Sie uns bitte unverzüglich telefonisch oder per E-Mail.

This message is intended only for the use of the individual or entity to which it is addressed. If you have received this message by mistake, please notify us immediately.


Von: Users <[hidden email]> im Auftrag von Răzvan Crainea <[hidden email]>
Gesendet: Mittwoch, 7. Juni 2017 14:08:44
An: [hidden email]
Betreff: Re: [OpenSIPS-Users] ratelimit (cps/timer_interval)
 
Hello, Max!

If you want to limit to 50 CPS, you should use:
if (!rl_check("$avp(carriername)", "50", "RED"))

I will update the docs to reflect this.

Best regards,
Răzvan Crainea
OpenSIPS Solutions
www.opensips-solutions.com
On 06/07/2017 01:07 PM, Max Mühlbronner wrote:

Hi,


just a small question regarding the ratelimit module. I am confused by the documentation:


rl_check():


"Note that the limit should be specified as per-second, not per-timer_interval."



But at the timer_interval modparam it says:


"All amounts of messages have to be divided by this timer to get a messages per second value. "




So which one is true, e.g. if i want to limit to 50 cps (and the default timer_interval is 10 seconds) would i just do something like:


if (!rl_check("$avp(carriername)", "50", "RED")) {
...


Or


if (!rl_check("$avp(carriername)", "500", "RED")) {





Thanks.


BR


Max Mühlbronner
------
42com Telecommunication GmbH
Straße der Pariser Kommune 12-16
10243 Berlin

Fon: +49-(0)30-2434299-28
Fax: +49-(0)30-2434299-99
E-Mail: [hidden email]
Web: 
www.42com.com


Firmenangaben/Company information:
Handelsregister/Commercial register: Amtsgericht Berlin HRB 99071 B
Umsatzsteuer-ID/VAT-ID: DE223812306
Geschäftsführer/CEO: Thomas Reinig, Alexander Reinig

Diese E-Mail enthält Informationen von 42com Telecommunication GmbH. Diese sind möglicherweise vertraulich und ausschließlich für den Adressaten bestimmt. Sollten Sie diese elektronische Nachricht irrtümlicherweise erhalten haben, so informieren Sie uns bitte unverzüglich telefonisch oder per E-Mail.

This message is intended only for the use of the individual or entity to which it is addressed. If you have received this message by mistake, please notify us immediately.



_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Loading...