Hello,
I have 2 stateful kamailio servers that receive incoming requests, load balanced across the 2 servers by our carrier trunk partners (outside of our control).
I am looking at putting certain invites from these trunks into pipelimit to rate limit under some conditions but I have some questions:
1. How will pipelimit establish rates when requests can come in to either of my servers?
2. If pipelimit decides it is time to limit the requests, will both servers respect that limit?
3. does pipelimit rely on a db or can it use dmq, redis or other methods for cross-server communication?
4. Is there a maximum number of pipes that can be defined?
Hope somebody can help me answer these questions.
With every blessing, — Daniel Donoghue
Hello,
pipelimit works only with a single instance, everything in memory, it does not have any storage or replication. It targets to catch high rates, like thousands of requests per seconds, in such case doing the replication will add delays, so the measurement won't be accurate across many nodes anyhow.
If you deal with lower rates, then you can use htable module, which has dmq replication. You can define a hash table with the expire interval you need for rates, then you have functions/variables to count number of items in the hash table. Probably something like this can be implemented with a redis server as well.
Otherwise, there is no hard limit of number of pipes for pipelimit.
Cheers, Daniel
On 16.02.21 08:38, Daniel Donoghue wrote:
Hello,
I have 2 stateful kamailio servers that receive incoming requests, load balanced across the 2 servers by our carrier trunk partners (outside of our control).
I am looking at putting certain invites from these trunks into pipelimit to rate limit under some conditions but I have some questions:
How will pipelimit establish rates when requests can come in to either of my servers?
If pipelimit decides it is time to limit the requests, will both servers respect that limit?
does pipelimit rely on a db or can it use dmq, redis or other methods for cross-server communication?
Is there a maximum number of pipes that can be defined?
Hope somebody can help me answer these questions.
With every blessing, — Daniel Donoghue
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Hi Daniel,
Thanks for your quick reply.
What kind of rates would you consider high and low?
We are processing an average of 300,000 invites per day
Blessings, — Daniel
On 16 Feb 2021, at 09:10, Daniel-Constantin Mierla miconda@gmail.com wrote:
Hello,
pipelimit works only with a single instance, everything in memory, it does not have any storage or replication. It targets to catch high rates, like thousands of requests per seconds, in such case doing the replication will add delays, so the measurement won't be accurate across many nodes anyhow.
If you deal with lower rates, then you can use htable module, which has dmq replication. You can define a hash table with the expire interval you need for rates, then you have functions/variables to count number of items in the hash table. Probably something like this can be implemented with a redis server as well.
Otherwise, there is no hard limit of number of pipes for pipelimit.
Cheers, Daniel
On 16.02.21 08:38, Daniel Donoghue wrote:
Hello,
I have 2 stateful kamailio servers that receive incoming requests, load balanced across the 2 servers by our carrier trunk partners (outside of our control).
I am looking at putting certain invites from these trunks into pipelimit to rate limit under some conditions but I have some questions:
How will pipelimit establish rates when requests can come in to either of my servers?
If pipelimit decides it is time to limit the requests, will both servers respect that limit?
does pipelimit rely on a db or can it use dmq, redis or other methods for cross-server communication?
Is there a maximum number of pipes that can be defined?
Hope somebody can help me answer these questions.
With every blessing, — Daniel Donoghue
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
-- Daniel-Constantin Mierla -- www.asipto.com www.twitter.com/miconda -- www.linkedin.com/in/miconda Funding: https://www.paypal.me/dcmierla
On 2/16/21 4:38 AM, Daniel Donoghue wrote:
What kind of rates would you consider high and low?
We are processing an average of 300,000 invites per day
300,000 invites/day doesn't really say much about how they're distributed or how bursty they are.
Is it 300,000 invites over 8 hours (implying about 10.5 CPS), or over 24 hours (3.5 CPS)? Are they relatively uniformly distributed in time, or is the median CPS wildly different from the average CPS over that sampling period?
-- Alex
Good point,
The calls are spread over an entire 24 hour period but with the bulk of them being within a 9 hour period each day. During that time we have an average of 6-7cps with bursts to 15cps. I have also seen bursts to 126-127cps on occasion (but rare) which are one of the reasons for my wanting to rate limit calls.
Blessings, — Daniel
On 16 Feb 2021, at 20:16, Alex Balashov abalashov@evaristesys.com wrote:
On 2/16/21 4:38 AM, Daniel Donoghue wrote:
What kind of rates would you consider high and low? We are processing an average of 300,000 invites per day
300,000 invites/day doesn't really say much about how they're distributed or how bursty they are.
Is it 300,000 invites over 8 hours (implying about 10.5 CPS), or over 24 hours (3.5 CPS)? Are they relatively uniformly distributed in time, or is the median CPS wildly different from the average CPS over that sampling period?
-- Alex
-- Alex Balashov | Principal | Evariste Systems LLC
Tel: +1-706-510-6800 / +1-800-250-5920 (toll-free) Web: http://www.evaristesys.com/, http://www.csrpswitch.com/
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users