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
pgpcj7_qkBudK.pgp
Description: Firma digital OpenPGP
__________________________________________________________ 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!
