Hey Henning,<br><br><br><div class="gmail_quote">On Tue, Sep 22, 2009 at 12:46 PM, Henning Westerholt <span dir="ltr">&lt;<a href="mailto:henning.westerholt@1und1.de">henning.westerholt@1und1.de</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div style="font-family: &#39;Lucida Console&#39;; font-size: 9pt; font-weight: 400; font-style: normal;"><div class="im">On Dienstag, 22. September 2009, Jason Penton wrote:<br>
&gt; Hi Andrei,<br>
&gt;<br>
&gt; From what I have seen in the code this is pretty useless (no offence).<br>
&gt;<br>
&gt; The ping in this particular instance is only executed JUST before a real<br>
&gt; query is to be issued. i.e. if a query is not used in Kamailio for a couple<br>
&gt; of hours - the ping is actually never sent...........<br>
<p style="margin: 0px; text-indent: 0px;"><br></p></div>Hi Jason,<br>
<p style="margin: 0px; text-indent: 0px;"><br></p>you&#39;re right that its not executed with a timer or similar, but the mysql_ping() should reconnect to the database if the auto reconnect is activated, according the documentation:<br>

<p style="margin: 0px; text-indent: 0px;"><br></p><a href="http://dev.mysql.com/doc/refman/5.0/en/mysql-ping.html" target="_blank">http://dev.mysql.com/doc/refman/5.0/en/mysql-ping.html</a></div></blockquote><div><br>Actually the reconnect doesnt work if your firewall has torn down the connection. You can try this with other mysql clients like - the usual client, toad, etc. Leave your connection idle for about 45 mins and you will see that there&#39;s nothing you can do to reconnect.<br>
<br>I have tested this extensively and can only imageine that because the firewall has closed the connection, the reconnect in mysql doesnt work - because the socket has been torn down underneath mysql (at the OS level). So effectively you see a hangin process in Kamailio up to 5 minutes :) which is REALLLLLLLLY bad :D<br>
<br>Ok so I am going to go ahead with using a timer to ping the mysql cons in the db_pool. Everyone happy with that?<br><br>Cheers<br>Jason <br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div style="font-family: &#39;Lucida Console&#39;; font-size: 9pt; font-weight: 400; font-style: normal;"><div class="im"><br>
<p style="margin: 0px; text-indent: 0px;"><br></p>&gt; what I have noticed is that when the connection is torn down by the<br>
&gt; firewall, the ping actually hangs (reconnect fails), etc<br>
&gt;<br>
&gt; So, we NEED a proper ping (keepalive) functionality :D<br>
<p style="margin: 0px; text-indent: 0px;"><br></p></div>This could be implemented with help of the internal timers, just execute periodically the mysql_ping command, for example.<br><font color="#888888">
<p style="margin: 0px; text-indent: 0px;"><br></p>Henning</font></div></blockquote></div><br>