<div dir="ltr">Hello,<br>I'm trying to find the best way to control calls coming to my opensips box using the Ratelimit module.<br>i'm setting a specific cps limit to each customer via its ip source and i want precision and accuracy without exhausting my server (vultr virtual machine 2 cores, 4gb ram with 2gb dedicated to opensips shared memory and 32m shared + 8 udp workers with a profile scalling up to 16 workers on 70% load)<br>I was able to achieve what I wanted by using the SBT algorithm, a window_size of 1 second and slot_period of 200 milliseconds, 5 slots in total. Most of my customers have a 5 to 20 cps limit.<br><br><pre class="gmail-notranslate" style="box-sizing:border-box;font-family:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,"Liberation Mono",monospace;font-size:11.9px;margin-top:0px;margin-bottom:16px;padding:16px;overflow:auto;line-height:1.45;border-radius:6px;color:rgb(36,41,47)"><code class="gmail-notranslate" style="box-sizing:border-box;font-family:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,"Liberation Mono",monospace;padding:0px;margin:0px;background:transparent;border-radius:6px;word-break:normal;border:0px;display:inline;overflow:visible;line-height:inherit">modparam("ratelimit", "window_size", 1)
modparam("ratelimit", "slot_period", 200)</code></pre><div><span style="background-color:transparent;font-family:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,"Liberation Mono",monospace;color:rgb(36,41,47);font-size:11.9px">if(!rl_check("RL_$si", 5, "SBT")) send_reply("403", "Cps Exceeded");<br><br>I admit not being able to understand how the SBT algorithm works via the documentation, I wanted to know if the values i set for window_size and slot_period are the best for CPS Limitation.<br>Also do you confirm that SBT is the most accurate among other ratelimit algorithms for calls per second limitation ?<br><br>Thank you<br><br><br></span></div><div><font color="#24292f" face="ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace"><span style="font-size:11.9px"><br></span></font><br><br><br></div></div>