<div dir="ltr"><div dir="ltr"><div dir="ltr">On the high CPS box its an old OpenSIPs 1.9 instance running 64 children IIRC on a pair of old 6 core Westmere Core Xeons. On a 2.2 box the code looks sort of like this:<br></div><div dir="ltr"><br></div><div dir="ltr"># memcached config<br>modparam("cachedb_memcached", "cachedb_url", "memcached:blacklist://<a href="http://127.0.0.1:11211/">127.0.0.1:11211/</a>")</div><div dir="ltr"><br></div><div><br></div><div># in the main route block<br></div><div dir="ltr"></div><div dir="ltr">if (cache_fetch("memcached:
blacklist

", "$avp(key)", $avp(value)))        <br></div><div dir="ltr">{</div><div>   #reject the call or something<br></div><div dir="ltr">}<br></div><div dir="ltr"><br></div><div>The only other possible downside to memcached is the lack of longest prefix match, which you may not need. You also need to build the Memcached.<br></div><div><br></div><div>I don't have any OpenSIPs Redis code samples handy, as I think I've only used it with that other open source SIP server.</div><div><br></div><div>Since the data is not being loaded into OpenSIPs memory, startup times are considerably faster. With memcached you need to remember or script it to reload the blacklist into memory on reboot or restart of memcached. <br></div><div><br></div><div>With Redis you can persist it, although make sure check the performance hit when you turn on persistence. AOF isn't bad, especially with a SSD disk. The background save can add a bunch of latency when it kicks off. <br></div><div>If its a lot of data, I usually do a BGSAVE once a day during off-peak times with a cron job. But I don't think 20-30 million entries will cause much disturbance.<br></div><div><br></div><div>- Jon<br></div></div></div><br><div class="gmail_quote"><div dir="ltr">On Sun, Sep 30, 2018 at 9:13 AM Abdul Basit <<a href="mailto:basit.engg@gmail.com">basit.engg@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Hi Jon,</div><div><br></div><div>Good to know.</div><div>If possible, can you share the settings you have for opensips?</div><div>Whats the server hardware specification?<br></div><div>Whats opensips service startup time?</div><br clear="all"><div><div dir="ltr" class="m_3034333113528093945gmail_signature" data-smartmail="gmail_signature"><div><font size="2"><span style="font-family:verdana,sans-serif"><span style="color:rgb(39,78,19)">--<br>regards,</span></span></font></div><font size="2"><span style="font-family:verdana,sans-serif"><span style="color:rgb(39,78,19)"><br>abdul basit</span></span></font></div></div></div><br><div class="gmail_quote"><div dir="ltr">On Sun, 30 Sep 2018 at 05:17, Jon Abrams <<a href="mailto:ffshoh@gmail.com" target="_blank">ffshoh@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>I have used memached to store 20-30 million entry blacklists while maintaining 6000-9000 responses per second on a dipping server. The downside is its not persistent. <br></div><div><br></div><div>I've used redis as well to store the whole North American LNP database in memory, but I've only tried pushing it to a couple thousand CPS so far. I would imagine it would perform at least as well as the memcached if needed.</div><div><br></div><div>I wouldn't worry about the speed difference between local cache speed and using Redis/Memcached over a socket in a normal deployment scenario.</div><div><br></div><div>- Jon<br></div></div><br><div class="gmail_quote"><div dir="ltr">On Sat, Sep 29, 2018 at 6:17 PM Abdul Basit <<a href="mailto:basit.engg@gmail.com" target="_blank">basit.engg@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi team,<div><br></div><div>I am thinking to do horizontal scaling through dispatcher module and sharding the blacklist to 2 or 3 opensips nodes local cache.<br></div><div>or using redis for blacklist repository but local cache is even more quick. </div><div><br></div><div>Any comments or experience to share about the problem I am facing currently?<br clear="all"><div><div dir="ltr" class="m_3034333113528093945m_-4984419569388100811m_-3243070812071123206gmail_signature" data-smartmail="gmail_signature"><div><font size="2"><span style="font-family:verdana,sans-serif"><span style="color:rgb(39,78,19)"><br></span></span></font></div><div><font size="2"><span style="font-family:verdana,sans-serif"><span style="color:rgb(39,78,19)">--<br>regards,</span></span></font></div><font size="2"><span style="font-family:verdana,sans-serif"><span style="color:rgb(39,78,19)"><br>abdul basit</span></span></font></div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr">On Fri, 28 Sep 2018 at 06:10, Abdul Basit <<a href="mailto:basit.engg@gmail.com" target="_blank">basit.engg@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Hi team,</div><div><br></div><div>I have a opensips 2.4 deployed having 4 children and with mysql configured for loading user blacklist to opensips local cache on opensips startup.<br></div><div>Opensips work fine on filtering the call based on user blacklist records loaded into local cache. </div><div><br></div><div>While blacklist was growing upto 1.3m records, opensips startup was taking ~60 sec on VM of 16GB RAM and 6 CPU.<br></div><div>I increased shared memory to <b>6144</b> and package memory to <b>256.</b><br></div><div>Filter works fine here yet. Call load is not that much only blacklist entries are growing.</div><div><br></div><div>But now blacklist has grown to very huge number, up to 10m records in mysql. Opensips is not starting successfully and service startup requests timeout after huge CPU spikes while trying to populate local cache from mysql. <br></div><div>I increased shared memory to <b>12288</b> and package memory to <b>1024</b> but no success yet.</div><div><br></div><div>I indexed mysql blacklist table but no luck.</div><div><br></div><div>Please advise what settings I should add to opensips for successful startup. </div><div><br></div><div><div dir="ltr" class="m_3034333113528093945m_-4984419569388100811m_-3243070812071123206m_2815879888628333912gmail_signature" data-smartmail="gmail_signature"><div><font size="2"><span style="font-family:verdana,sans-serif"><span style="color:rgb(39,78,19)">--<br>regards,</span></span></font></div><font size="2"><span style="font-family:verdana,sans-serif"><span style="color:rgb(39,78,19)"><br>abdul basit</span></span></font></div></div></div>
</blockquote></div>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
</blockquote></div>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
</blockquote></div>
</blockquote></div>