[sr-dev] running out of mysql connections when [group] is given

Daniel-Constantin Mierla miconda at gmail.com
Wed Jan 21 23:43:18 CET 2015


On 21/01/15 23:21, Juha Heinanen wrote:
> Daniel-Constantin Mierla writes:
>
>> This doesn't have to do with kamailio at all, it is mysql client
>> configuration in my.cfg.
>>
>> Kamailio itself uses mysql_options() to set the group to be used:
>>   - http://dev.mysql.com/doc/refman/5.5/en/mysql-options.html
>>
>> It is nothing else that kamailio can do. So whatever mysql supports for
>> groups in my.cnf it is the mysql client library that deals with. Looking
>> at above documentation and kamailio code, the order is right, so all
>> seems fine in the code. If you cannot find something in mysql docs, it
>> is a lack on their side.
>>
>> Therefore I don't think the kamailio docs need to be updated with your
>> remark -- again, that is about what mysql client library supports.
> if i add line:
>
> ssl-ca=/etc/mysql/ca-cert.pem
>
> to [client] section of my.cfg and connect to the server with mysql cli
> command
>
> mysql -u root -p
>
> i get:
>
> mysql> show status like 'ssl_cipher';
> +---------------+--------------------+
> | Variable_name | Value              |
> +---------------+--------------------+
> | Ssl_cipher    | DHE-RSA-AES256-SHA |
> +---------------+--------------------+
> 1 row in set (0.00 sec)
>
> showing that ssl is used.  without the ssl-ca line Value is empty
> showing that ssl is not used.
>
> when i execute in my kamailio config:
>
>     sql_query("sip_proxy", "show status like 'ssl_cipher'", "result");
>     xlog("L_INFO", "**** got result <variable=$dbr(result=>[0, 0])/value=$dbr(result=>[0, 1])>\n");
>     sql_result_free("result");
>
> i get:
>
> Jan 22 00:05:53 siika /usr/bin/sip-proxy[6735]: INFO: **** got result <variable=Ssl_cipher/value=>
>
> showing that ssl is not used even when ssl-ca line is in [client]
> section of my.cfg.
>
> according to db_mysql README:
>
>    In addition to the given group, also the [client] section is read, in
>    the order given in my.cnf.
>
> if that is true, why is ssl not used for queries as specified in my.cfg?
A book indexed by google says that [client] section is also read along
with the custom group. The example is shown with Perl, but I guess the
same client library is behind. Same seems to be suggested in the perl docs:

 -
http://search.cpan.org/~capttofu/DBD-mysql-4.029/lib/DBD/mysql.pm#Class_Methods

Now, those can be old, maybe newer versions of mysql client library
behave differently.

Have you tried to put all wanted options to the group?

Daniel

-- 
Daniel-Constantin Mierla
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda




More information about the sr-dev mailing list