High volume ratelimit CPS
"Jon Bonilla (Manwe) via sr-users" <[email protected]>
| Newsgroups | gmane.comp.voip.ser |
|---|---|
| Message-ID | <[email protected]> |
Hi all
Some time ago I asked about a way of limiting the CAPS sent to differnet
gateways and in high CPS environment.
I ended up implementing a htable based solution suggested by one member of the
list. The solution was more or less like this one:
modparam("htable", "htable", "caps=>size=11;initval=0;autoexpire=5;")
modparam("htable", "timer_interval", 10)
modparam("htable", "timer_procs", 4)
$var(cps) = $rd + ":" + $timef(%S);
$var(cps) = $shtinc(caps=>$var(cps));
if ($var(cps) > $var(capslimit)) {
sl_send_reply("503", "CAPS limit reached for this destination $rd");
exit;
}
The problem with this approach is that it's not fast enough detecting the
limit. If I set 500 CAPS as limit it will sometimes reach 550, 600, or even 700
before it rejects the rest of the requests during that second. I have complains
from the destination and they are asking me to be more precise in the ratelimit
process.
Would ratelimit/pipelimit improve this? I don't even know if they would accept
handling 1 second intervals at this rate.
Any other suggestion?
cheers,
Jon
--
PekePBX, the multitenant PBX solution
https://pekepbx.com
__________________________________________________________
Kamailio - Users Mailing List - Non Commercial Discussions -- [email protected]
To unsubscribe send an email to [email protected]
Important: keep the mailing list in the recipients, do not reply only to the sender!
signature.asc
(application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEeCM0ZbH8r7OFHtBdv/8mNWfCIT8FAmk3JRIACgkQv/8mNWfC IT9pHRAApmB5JZ9k5d56iJ7WJx0ibINp1tDfdTcuVExURaMSPZt9h7F6AqKV6s3a bkoqT10lRMNZ3AHgR7+YLe3Swr/ACntrOzzbLSMUc8bjABp5CTPE2lTPs8DnXOBu eQw91vETLERJk5H6PX742nHNChxTPBBJhNyOTTWtD0TOM/YB1AQ8MxGdGvB4PjAp fu8+vxeqyVbYHQiT85JrCB/FCsWCWf/vbmZuIP17CFnzPTQkw9P0lgX8VsQm4QV5 QYl0cniw22j1uBsutpsUH1+0C2ryX7Ru+xsaajCzbrYjDAq+dyWVWtuqeExRqBHB HseoiiwnP8EfdG9MatXFqSmGEnB6EAWm+blSVSC4X4ghwmh021n2HtH3jhkAL5Fw 8NDA8/rIYpKTn9+4U9XtTCvqUkCJr4GJ5qU58F+ifIpdP1z4RdMjov6+kxqcNKt+ 7z2FK9yqhJDpKuJXfjhhuvkN1E+1ap+mbAo9pfF00S1099H5ngCcwDxK+NPAJ3l2 Mi/RoFKQl9+c3Awq5RDqKzU30MG6FkwQYmPIBPNHHPS6JWKWOYysnLCyoKJc8xu3 nm+BUzhLTXg8kHh9wtyP2vPhQbjk1mUJLyT7Rmi+iNOygH0h6JlhxS4QFMwXfKtV Zy25AqhHwWSCsPXMfHhjeYAuiTwqAHibHOlPDs7Vo8IgqSxHGX4= =uJxz -----END PGP SIGNATURE-----