Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Submitted By: Arnaud Boussus (aboussus)
Assigned to: Nobody/Anonymous (nobody)
Summary: New network-based algorithm in RateLimit
Bugfixed signed/unsigned byte sign in ipAddress happening when shifting and ANDing with 0xFF mask and reading IP addresses bytes greater than 127.
Added exported function "snmp_pending_bytes" from SNMPStats to be used with ratelimit module to drop incoming SIP message when rx_queue gets too high.
This algorithm relies on information provided by network interfaces. Indeed, it uses an exported function from SMTPStats module to work
(snmp_pending_bytes). The total amount of bytes waiting to be consumed on all the network interfaces is retrieved once every timer_interval seconds.
If the returned amount exceeds the limit specified in the modparam, OpenSIPS starts dropping SIP messages sending a 503 error (the default
value whose default message is "Service Unavailable").
where, in the pipe definition, 10000 is the max size of rx_queue (in bytes) before starting to answer "Service unavailable" and "network"
is a new source used to sample data from (in addition to "cpu" source).
Comment By: Ovidiu Sas (osas)
Date: 2009-03-19 18:06
The patch looks interesting. thanks for sharing it.
There is one issue: it creates a dependency on the snmpstats module.
Ratelimit should work even if the snmstats module is not loaded (not
everyone would want to load the snmpstats just to get basic ratelimit
Can you please re-work the patch and upload a new version?
Only when "load_source" is set to "network" the snmp_binds should be
Maybe the real solution here would be to create a new module on top of the
ratelimit module that will bind to the snmpstats and only this new module
will have the dependency on the snmpstats. This should be a cleaner way to
add this new functionality.