Below is an example kamailio.conf, where addition of [group] to "db_url" value increases number of mysql connections from 36 to 70. [group] is defined in in my.cfg as:
[group] ssl-ca=/etc/mysql/ca-cert.pem ssl-cert=/etc/mysql/client-cert.pem ssl-key=/etc/mysql/client-key.pem
With sqlops module alone the number of mysql connections is the same with or without [group].
kamailio.conf:
listen=192.98.102.33:5060 fork=yes log_stderror=no log_facility=LOG_LOCAL0 debug=2
loadmodule "tm" loadmodule "auth" loadmodule "sl" loadmodule "pv" loadmodule "auth_db" loadmodule "dialplan" loadmodule "domain" loadmodule "htable" loadmodule "permissions" loadmodule "pua" loadmodule "db_mysql" loadmodule "sqlops" loadmodule "xlog"
modparam("auth_db|dialplan|domain|htable|permissions|pua", "db_url", "mysql://user:pass@[group]127.0.0.1/sip_proxy") modparam("sqlops", "sqlcon", "sip_proxy => mysql://user:pass@[group]127.0.0.1/sip_proxy")
route {
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"); exit;
}
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/58
Wondering if it is the ssl or the [group] causing more connections. IIRC, the connection id is based on URL, if there are modules using the default DB URL, it can create a different connection. Have you tried with group and without tls?
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/58#issuecomment-72009268
Daniel-Constantin Mierla writes:
Wondering if it is the ssl or the [group] causing more connections. IIRC, the connection id is based on URL, if there are modules using the default DB URL, it can create a different connection. Have you tried with group and without tls?
I just tried and you were correct, it is the group that creates the extra connections.
In the example kamailio.conf, no module uses default DB URL, i.e., the DB URL is explicitly defined for all of them.
-- Juha
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/58#issuecomment-72146230
So it is the database connection id matching that has some issue when the group is specified -- iirc, the code is in lib/srdbq. I will try to look over it in the near future, traveling for the moment, but maybe I get a bit of spare time.
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/58#issuecomment-72156029
After a quick look to db_mysql module I spotted and issue when handling urls with groups. A char wwas replaced with 0 inside the url, which could be the reason to get more connection, as another check with same url won't match it.
I pushed a patch to master branch, if you test and all is ok, you can go ahead and backport.
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/58#issuecomment-72176732
Daniel-Constantin Mierla writes:
After a quick look to db_mysql module I spotted and issue when handling urls with groups. A char wwas replaced with 0 inside the url, which could be the reason to get more connection, as another check with same url won't match it.
I pushed a patch to master branch, if you test and all is ok, you can go ahead and backport.
Thanks for the fix. Now number of mysql connections is the same with or without [group].
-- Juha
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/58#issuecomment-72299309
Are we done with this issue and can close it?
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/58#issuecomment-73116545
Closed #58.
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/58#event-231061493
Olle E. Johansson writes:
Are we done with this issue and can close it?
Yes, it can be closed. I tried to do it, but was not able to figure out how. It looked that I would first need assign the issue to me, but that would not have been correct, because it was Daniel who fixed the bug.
-- Juha
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/58#issuecomment-73130626