[OpenSIPS-Users] OpenSIPS maximum performance in a multiprocessor machine (SMP)

Bogdan-Andrei Iancu bogdan at voice-system.ro
Tue Sep 15 08:58:14 CEST 2009


Italo Dacosta wrote:
>> Ok - that's the first problem. Number of children == number of
>> processes. You cannot handle more than 4 messages at one time right
>> now.
>>     
>
> I forgot to mention that I tested with several number of children
> already. Surprisingly, increasing the number of processes seems to
> reduce performance. With 8 children processes the maximum call rate I
> measured was around 17,000 cps. I think that the performance is lower
> due to the overheads associated with context switching.
>
> As I have observed, OpenSIPS uses 4 additional processes in addition to
> the children processes (two timer-related processes,
on is the time keeper and the other the default timer process/
>  one for the mi_fifo
>  module mgt. interface
if you want to get rid of it, simply unload the mi_fifo module
>  and the parent process?).
the parent process becomes the attendant - it is a process doing nothing 
(really nothing) and simply catching the SIGCHILD signals form the 
worker processes. The only purpose of this thread is to detect when 
something went wrong (another proc died) and to trigger proper shutdown. 
Not doing anything is a good way of being sure that proc will survive 
all the other :)

>  Therefore, if I use 4
> children processes, a total of 8 processes will be running. However, I
> am not sure that these additional processes are CPU intensive as the
> processes handling SIP messages.
>   
not really doing something - mi_fifo is simply waiting on a socket for 
commands, attendant proc is doing sleep. The time keeper job is simple 
(incrementing a time variable), while the timer proc is running all the 
timer handlers - in your cfg, only usrloc has timer subroutine for 
detecting expired contacts.
>   
>> Also - what modules are enabled and how does your usrloc find the
>> location - is it db query, or something else? If you use anything
>> external for lookup, I'd change children to 16 (if memory only, then
>> 8)
>>     
>
> usrloc is using memory (database mode is disabled). These are the
> modules enabled:
>
> loadmodule "db_mysql.so"
> loadmodule "signaling.so"
> loadmodule "sl.so"
> loadmodule "tm.so"
> loadmodule "rr.so"
> loadmodule "maxfwd.so"
> loadmodule "usrloc.so"
> loadmodule "registrar.so"
> loadmodule "textops.so"
> loadmodule "mi_fifo.so"
> loadmodule "uri_db.so"
> loadmodule "uri.so"
> loadmodule "xlog.so"
>   
Note that usrloc has data structures that are shared between all procs. 
Sharing means locking for synchronized access. By default usrloc uses a 
hash with 512 entries, each entry having its one lock.
Typically access to such shared data may be a bottleneck - procs 
blocking in lock trying to access some resource. So, to increase the 
level of parallelism and hash entry collisions, you could try increase 
the size of this hash table:
       http://www.opensips.org/html/docs/modules/devel/usrloc.html#id271533
Try a value of 12 for example.

Regards,
Bogdan




More information about the Users mailing list