[OpenSIPS-Users] opensips will not start while loading huge blacklist

Abdul Basit basit.engg at gmail.com
Sun Sep 30 18:24:04 EDT 2018


Hi Jon,

Thanks, I'll check it out with memcached and Redis both.
Current disturbance is opensips restart due to localcache loading from
mysql. Once loaded, it works like a charm.

Any idea about *-m* and *-M* vales? How much RAM was allocated to the box?

Opensips performed better when I increased shared and package memory.
I want to avoid overkill of resources.

--
regards,

abdul basit

On Sun, 30 Sep 2018 at 20:00, Jon Abrams <ffshoh at gmail.com> wrote:

> 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:
>
> # memcached config
> modparam("cachedb_memcached", "cachedb_url", "memcached:blacklist://
> 127.0.0.1:11211/")
>
>
> # in the main route block
> if (cache_fetch("memcached: blacklist ", "$avp(key)", $avp(value)))
> {
>    #reject the call or something
> }
>
> 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.
>
> 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.
>
> 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.
>
> 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.
> 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.
>
> - Jon
>
> On Sun, Sep 30, 2018 at 9:13 AM Abdul Basit <basit.engg at gmail.com> wrote:
>
>> Hi Jon,
>>
>> Good to know.
>> If possible, can you share the settings you have for opensips?
>> Whats the server hardware specification?
>> Whats opensips service startup time?
>>
>> --
>> regards,
>>
>> abdul basit
>>
>> On Sun, 30 Sep 2018 at 05:17, Jon Abrams <ffshoh at gmail.com> wrote:
>>
>>> 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.
>>>
>>> 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.
>>>
>>> I wouldn't worry about the speed difference between local cache speed
>>> and using Redis/Memcached over a socket in a normal deployment scenario.
>>>
>>> - Jon
>>>
>>> On Sat, Sep 29, 2018 at 6:17 PM Abdul Basit <basit.engg at gmail.com>
>>> wrote:
>>>
>>>> Hi team,
>>>>
>>>> I am thinking to do horizontal scaling through dispatcher module and
>>>> sharding the blacklist to 2 or 3 opensips nodes local cache.
>>>> or using redis for blacklist repository but local cache is even more
>>>> quick.
>>>>
>>>> Any comments or experience to share about the problem I am facing
>>>> currently?
>>>>
>>>> --
>>>> regards,
>>>>
>>>> abdul basit
>>>>
>>>>
>>>> On Fri, 28 Sep 2018 at 06:10, Abdul Basit <basit.engg at gmail.com> wrote:
>>>>
>>>>> Hi team,
>>>>>
>>>>> 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.
>>>>> Opensips work fine on filtering the call based on user blacklist
>>>>> records loaded into local cache.
>>>>>
>>>>> While blacklist was growing upto 1.3m records, opensips startup was
>>>>> taking ~60 sec on VM of 16GB RAM and 6 CPU.
>>>>> I increased shared memory to *6144* and package memory to *256.*
>>>>> Filter works fine here yet. Call load is not that much only blacklist
>>>>> entries are growing.
>>>>>
>>>>> 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.
>>>>> I increased shared memory to *12288* and package memory to *1024* but
>>>>> no success yet.
>>>>>
>>>>> I indexed mysql blacklist table but no luck.
>>>>>
>>>>> Please advise what settings I should add to opensips for successful
>>>>> startup.
>>>>>
>>>>> --
>>>>> regards,
>>>>>
>>>>> abdul basit
>>>>>
>>>> _______________________________________________
>>>> Users mailing list
>>>> Users at lists.opensips.org
>>>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>>>
>>> _______________________________________________
>>> Users mailing list
>>> Users at lists.opensips.org
>>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20181001/38a1c569/attachment.html>


More information about the Users mailing list