[sr-dev] DB API and connection keepalive

Henning Westerholt henning.westerholt at 1und1.de
Tue Sep 22 12:46:50 CEST 2009


On Dienstag, 22. September 2009, Jason Penton wrote:
> Hi Andrei,
>
> From what I have seen in the code this is pretty useless (no offence).
>
> The ping in this particular instance is only executed JUST before a real
> query is to be issued. i.e. if a query is not used in Kamailio for a couple
> of hours - the ping is actually never sent...........

Hi Jason,

you'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:

http://dev.mysql.com/doc/refman/5.0/en/mysql-ping.html

> what I have noticed is that when the connection is torn down by the
> firewall, the ping actually hangs (reconnect fails), etc
>
> So, we NEED a proper ping (keepalive) functionality :D

This could be implemented with help of the internal timers, just execute 
periodically the mysql_ping command, for example.

Henning
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-dev/attachments/20090922/f9fb6bf8/attachment.htm>


More information about the sr-dev mailing list