[OpenSIPS-Users] recommended settings for performance
Bogdan-Andrei Iancu
bogdan at opensips.org
Tue Feb 9 12:23:19 CET 2016
Alex,
There is no magic way to pre-determin the ratio between the number of
children and CPU cores - it depends on how intensive and slow are your
I/O's. OF course, you can try to do some simple math, just to give you a
point to start. Assuming:
- the I/O's for handling an INVITE (call) are 500 ms
- you want to get 100 cps
=> one process can do two calls per second (1s/0.5cps), so you need 50
processes...without considering the actual computation time.
Of course, this is valid for OpenSIPS pre 2.0 version. Starting with
2.x, there is no actual blocking because of I/Os (DB, REST, EXEC), so
you should consider your OpenSIPS doing only CPU time (no blocking in
I/O's) - in this async setup makes no sense to have more processes than
CPU cores.
Anyhow, the best way to do it is to estimate a bit the starting number
for processes and do realtime monitoring of the processes load (using
the load statistics) to get a real impression on the internal load.
Now, how far an application can scale (by increasing the number of
parallel processes) is a totally different story. And indeed, internal
resources my become a bottleneck.
This is the reason for having the HP (High-Performance) memory manager
added into OpenSIPS - it dramatically reduces the collision between
processes while working over shared memory - this was indeed noticed and
addressed while running tests with ~ +30.000 calls per second on a
single OpenSIPS instance.
Such bottleneck were the reasons for partitioning the TM timers (to
allow the timer lists in TM to be partitioned across multiple processes
and eventually horizontally scaled) and for changing the overall timers
implementation in OpenSIPS - drop the single timer process and replaces
with timer jobs distributed (load based) to any available internal process.
(sorry for the long reply)
Regards,
Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
http://www.opensips-solutions.com
On 05.02.2016 17:54, Alex Balashov wrote:
> Bogdan,
>
> For moderately I/O-bound processing, what is the optimal number of
> child processes in relation to CPU cores?
>
> You say that the number of child processes can exceed available cores
> (i.e. nproc). By how much? Where is the point at which contention,
> locking and waiting leads to diminishing returns?
>
> My personal experience suggests that on an 8-core system,
> architectural diminishing returns of this sort appear quite rapidly,
> and that 32 would be far too many worker processes. However, last time
> I really experimented was some years ago.
>
> -- Alex
>
> --
> Alex Balashov | Principal | Evariste Systems LLC
> 303 Perimeter Center North, Suite 300
> Atlanta, GA 30346
> United States
>
> Tel: +1-800-250-5920 (toll-free) / +1-678-954-0671 (direct)
> Web: http://www.evaristesys.com/, http://www.csrpswitch.com/
>
> Sent from my BlackBerry.
> *From: *Bogdan-Andrei Iancu
> *Sent: *Friday, February 5, 2016 05:45
> *To: *OpenSIPS users mailling list; Søren Andersen
> *Reply To: *OpenSIPS users mailling list
> *Subject: *Re: [OpenSIPS-Users] recommended settings for performance
>
>
> Hi Søren,
>
> The throughput of your opensips highly depends on your script - if
> your logic is complex, if it performs many external queries
> (db,radius, rest, etc). It is more test and see approach - monitor the
> load of your opensips and adjusted based on your observations .
>
> Trying to answer to your questions:
>
> 1) assuming there is a need for CPU processing, you should configure a
> number of total processes (in opensips) at least equal to the number
> of cores - the opensips as overall app can use all the cores in the
> same time.
>
> 2) I guess you mean about memory ? if you have large CPS / parallel
> calls / registrations, consider increasing the shm memory - anyhow,
> inspect the mem usage at runtime with "opensipsctl fifo get_statistics
> shmem: " and re-adjust
>
> 3) if you script is I/O intensive (DNS, DB, RADIUS, REST), better have
> a large number of processes (32?). If not, try to correlated with the
> number of cores you have. Also, adjust on the run by checking the
> internal load via "opensipsctl fifo get_statistics load: "
>
> Regards,
> Bogdan-Andrei Iancu
> OpenSIPS Founder and Developer
> http://www.opensips-solutions.com
> On 01.02.2016 23:31, Søren Andersen wrote:
>>
>> Hello there,
>>
>> I’m looking for some reference configs on opensips performance.
>>
>> -How many cpu cores are you using and how many CPS are you peaking at?
>>
>> -Which startoptions in opensipsctlrc are you using?
>>
>> -How many opensips process children are you running?
>>
>> Currently I’m planning to use STARTOPTIONS="-m 2048 -M 8" on a 2 core
>> VM with children=8. – I hope I’ll be able to run 600-1500 currently
>> call on that setup. But that are your experience?
>>
>> /Søren
>>
>>
>>
>> _______________________________________________
>> 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/20160209/a9fb0514/attachment-0001.htm>
More information about the Users
mailing list