[Kamailio-Users] ERROR:mysql:db_mysql_new_connection: driver error: Too many connections

Ovidiu Sas osas at voipembedded.com
Thu Sep 4 15:38:32 CEST 2008


lcr: it doesn't use the db during the normal operation
dispatcher: it doesn't use the db during the normal operation
carrierroute: it doesn't use the db during the normal operation

avpops: it is the only module that will perform db transactions during
normal operations (if you are performing them from the script).

Check your script and see what kind of operations are you doing.
Remove them and see if this will help.  Also check if you are doing
dns lookups.  Check how much logging are you performing.  Check your
debug level (don't run with debug=9).  There are lots of things to
check and fine tuning to perform before putting the system in
production.  Especially for systems under high load.


Regards,
Ovidiu Sas

On Thu, Sep 4, 2008 at 7:04 AM, Samael - <samael.zgz at gmail.com> wrote:
> Thanks for your response.
>
> We realized that with 200 children the problem is still happing.
>
> We are using db ( MySQL 5 ) in every request in the config file through the
> following modules:
>
>     - lcr: to check every request where come from
>
>     - dispatcher: to make load balancing with a pool of asterisk in cluster
>
>     - avpsops: to use some user preferences
>
>     - carrieroute: to balance outbound calls to several providers
>
> Is this a high load of db transactions to the openser?
>
> Regards
>
>
> 2008/9/3 Ovidiu Sas <osas at voipembedded.com>
>>
>> Increasing the number of children to 200 will not help.
>> Most likely, your config is doing something 'wrong' or being terribly
>> intensive on mysql db.
>> Openser is very light and it can handle lot's of transaction, but if
>> you are using a slow db and you are doing db queries during your
>> transaction processing, then your server will be slow.
>>
>> Check your config and see what's going 'wrong' there.
>>
>> As a reference, openser is able to do 150 cps using a single child and
>> the CPU is barely utilized (on a slow machine).
>>
>>
>> Regards,
>> Ovidiu Sas
>>
>> On Wed, Sep 3, 2008 at 10:31 AM, Samael - <samael.zgz at gmail.com> wrote:
>> > Hi,
>> >
>> >
>> >
>> > We are deploying OpenSER in a large infrastructure together with
>> > Asterisk to
>> > support thousands of current transactions.
>> >
>> > We are using udp listener and mysql module in openser.
>> >
>> >
>> >
>> > We had to increase the children parameter of the openser.cfg to 200
>> > because
>> > Openser couldn't handle the high amount of concurrent SIP REQUESTs from
>> > ASTERISK (Not only INVITES, but also a lot of SIP OPTIONs), that means
>> > that
>> > Openser couldn't handle more than 'children' REQUEST loosing the rest of
>> > the
>> > concurrent REQUEST.
>> >
>> > children=200
>> >
>> >
>> >
>> > But then, the following error appeared in the openser:
>> >
>> > ERROR:mysql:db_mysql_new_connection: driver error: Too many connections
>> >
>> >
>> >
>> > This is because the Standard parameter of mysql "max_connections" is set
>> > to
>> > 100.
>> >
>> >
>> >
>> > In mysql CLI, we can see that every child process of openser has a mysql
>> > connection. (see in Mysql> SHOW PROCESSLIST)
>> >
>> >
>> >
>> > The recommended max_connections parameter is 500-1000 => we have a limit
>> > of
>> > 500-1000 concurrent SIP REQUEST to be processed by the openser.
>> >
>> >
>> >
>> > Why there is a process for every child?
>> >
>> >
>> >
>> > Why is neccesary a mysql connection for every child?
>> >
>> > Can the openser have a pool of mysql connection to be used by thousands
>> > of
>> > children?
>> >
>> > Regards
>> >
>> > _______________________________________________
>> > Users mailing list
>> > Users at lists.kamailio.org
>> > http://lists.kamailio.org/cgi-bin/mailman/listinfo/users
>> >
>> >
>
>
> _______________________________________________
> Users mailing list
> Users at lists.kamailio.org
> http://lists.kamailio.org/cgi-bin/mailman/listinfo/users
>
>




More information about the Users mailing list