[SR-Users] Number of sql connections

Alex Balashov abalashov at evaristesys.com
Mon Nov 19 21:25:11 CET 2018


Unfortunately, you can't. 

Every child worker process has its own database connections, and child
worker processes number (children * listeners).

This is actually by design; if database connections were shared among
child processes, then in high volume operations, the mutual exclusion
("mutex") locking required for multiple processes to share connections
would become a drag on performance. This way, every child process can
access the database in its own "lane" without having to fight with any
other process over a shared handle.

-- Alex

On Mon, Nov 19, 2018 at 07:18:48PM +0000, Duarte Rocha wrote:

> Greetings,
> 
> I have my core parameter listen like this :
> 
> listen=udp:eth0
> 
> children=12
> 
> Like this and the other settings, my kamailio has 21 threads and 20 Sql
> connections.
> 
> If I add more listens,
> 
> listen=udp:eth0
> listen=udp:eth0:5072
> listen=udp:eth0:5074
> 
> Now I have 45 threads and 45 Sql connections.
> 
> Why does this happen and can i set a a number of threads and/or sql
> connections that doesn't change with the number of "listen" parameters that
> i have ?
> 
> Best Regards,
> 
> Duarte Rocha

> _______________________________________________
> Kamailio (SER) - Users Mailing List
> sr-users at lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


-- 
Alex Balashov | Principal | Evariste Systems LLC

Tel: +1-706-510-6800 / +1-800-250-5920 (toll-free) 
Web: http://www.evaristesys.com/, http://www.csrpswitch.com/



More information about the sr-users mailing list