No subject


Wed Jul 15 11:24:54 CEST 2009


the mysql connections.(I'm I correct in this assumption?) So in my case, if
nothing is happening for 10s, MySQL disconnect us and I have this error
logged on the next activity to use the MySQL connection.

All in all this isn't that much of an issue, however we suffered a small
issue where our database maxed out his connections and while we expected
some stuff to failed, we didn't expect Kannel to died on us because of it:
2009-07-27 14:40:09 [3489] [3] ERROR: MYSQL: database check failed!
2009-07-27 14:40:09 [3489] [3] ERROR: MYSQL: Lost connection to MySQL server
during query
2009-07-27 14:40:09 [3489] [3] ERROR: MYSQL: can not connect to database!
2009-07-27 14:40:09 [3489] [3] ERROR: MYSQL: Too many connections
2009-07-27 14:40:10 [3489] [29] PANIC: DBPOOL: Deadlock detected!!!
2009-07-27 14:40:10 [3489] [29] PANIC: /usr/sbin/bearerbox(gw_panic+0xcc)
[0x80cc73c]
2009-07-27 14:40:10 [3489] [29] PANIC:
/usr/sbin/bearerbox(dbpool_conn_consume+0xec) [0x80bf71c]
2009-07-27 14:40:10 [3489] [29] PANIC: /usr/sbin/bearerbox [0x805e59e]
2009-07-27 14:40:10 [3489] [29] PANIC: /usr/sbin/bearerbox [0x805eaf4]
2009-07-27 14:40:10 [3489] [29] PANIC: /usr/sbin/bearerbox(dlr_add+0x33b)
[0x805d95b]
<....>

Since not being able to store the DLR in MySQL crashed Kannel, I believe
some effort should be put so that kannel can maintain the connection alive
correctly. I see 2 possible solutions:
1 - Have a timer that exec the mysql_check every n seconds (Configurable of
course)
2 - Send a set wait_timeout on connection to override the value from MySQL,
however in this case I don't know what we should set it to since the
mysql_ping is based on activity... (Maybe 8h ? since it's the default MySQL
value)

Solution 1 seems the best way to handle it, however solutions 2 may be
easier to implement (Comment on those?)

I may tried one of those change based on the feedback received, so feel free
to let me know your toughts :)
-- 
Math
aka ROunofF

rounoff at gmail.com

--00151750dec0c44fab046fb48170
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Hi,<br>=A0Context: We are storing Kannel&#39;s dlr in a MySQL database. Thi=
s database is used for some other applications as well and we set wait_time=
out=3D10 (<a href=3D"http://dev.mysql.com/doc/refman/5.1/en/server-system-v=
ariables.html#sysvar_wait_timeout" target=3D"_blank">http://dev.mysql.com/d=
oc/refman/5.1/en/server-system-variables.html#sysvar_wait_timeout</a>). Sin=
ce this is a &quot;global&quot; settings I can&#39;t change it for the Kann=
el DLR database only. While I could create a separate installation for the =
mysql dlr, there is some benefits for me to keep it together :)<br>

<br>Here&#39;s the log of the error happening:<br>2009-07-27 06:26:31 [3489=
] [3] ERROR: MYSQL: database check failed!<br>2009-07-27 06:26:31 [3489] [3=
] ERROR: MYSQL: Lost connection to MySQL server during query<br>2009-07-27 =
06:26:31 [3489] [3] INFO: MYSQL: Connected to server at db-XXXX01.<br>

2009-07-27 06:26:31 [3489] [3] INFO: MYSQL: server version 5.0.51a-15~bpo40=
+1-log, client version 4.1.11.<br><br>First, the point I want to confirm :<=
br><br>I see that there is a check method defined as mysql_ping in dbpool_m=
ysql.c. From what I found, it is only triggered when there is something hap=
pening on the mysql connections.(I&#39;m I correct in this assumption?) So =
in my case, if nothing is happening for 10s, MySQL disconnect us and I have=
 this error logged on the next activity to use the MySQL connection. <br>

<br>All in all this isn&#39;t that much of an issue, however we suffered a =
small issue where our database maxed out his connections and while we expec=
ted some stuff to failed, we didn&#39;t expect Kannel to died on us because=
 of it:<br>

2009-07-27 14:40:09 [3489] [3] ERROR: MYSQL: database check failed!<br>2009=
-07-27 14:40:09 [3489] [3] ERROR: MYSQL: Lost connection to MySQL server du=
ring query<br>2009-07-27 14:40:09 [3489] [3] ERROR: MYSQL: can not connect =
to database!<br>

2009-07-27 14:40:09 [3489] [3] ERROR: MYSQL: Too many connections<br>2009-0=
7-27 14:40:10 [3489] [29] PANIC: DBPOOL: Deadlock detected!!!<br>2009-07-27=
 14:40:10 [3489] [29] PANIC: /usr/sbin/bearerbox(gw_panic+0xcc) [0x80cc73c]=
<br>

2009-07-27 14:40:10 [3489] [29] PANIC: /usr/sbin/bearerbox(dbpool_conn_cons=
ume+0xec) [0x80bf71c]<br>2009-07-27 14:40:10 [3489] [29] PANIC: /usr/sbin/b=
earerbox [0x805e59e]<br>2009-07-27 14:40:10 [3489] [29] PANIC: /usr/sbin/be=
arerbox [0x805eaf4]<br>

2009-07-27 14:40:10 [3489] [29] PANIC: /usr/sbin/bearerbox(dlr_add+0x33b) [=
0x805d95b]<br>&lt;....&gt;<br><br>Since not being able to store the DLR in =
MySQL crashed Kannel, I believe some effort should be put so that kannel ca=
n maintain the connection alive correctly. I see 2 possible solutions:<br>

1 - Have a timer that exec the mysql_check every n seconds (Configurable of=
 course)<br>2 - Send a set wait_timeout on connection to override the value=
 from MySQL, however in this case I don&#39;t know what we should set it to=
 since the mysql_ping is based on activity... (Maybe 8h ? since it&#39;s th=
e  default MySQL value)<br>

<br>Solution 1 seems the best way to handle it, however solutions 2 may be =
easier to implement (Comment on those?)<br clear=3D"all"><br>I may tried on=
e of those change based on the feedback received, so feel free to let me kn=
ow your toughts :)<br>

-- <br>Math<br>aka ROunofF<br><br><a href=3D"mailto:rounoff at gmail.com" targ=
et=3D"_blank">rounoff at gmail.com</a><br>

--00151750dec0c44fab046fb48170--



More information about the devel mailing list