[sr-dev] DB API and connection keepalive

Daniel-Constantin Mierla miconda at gmail.com
Tue Sep 22 12:50:31 CEST 2009


Hello,

On 22.09.2009 12:46 Uhr, Henning Westerholt wrote:
> 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.

what are you referring as "internal timer" -- the connections are per 
process, not shared across them, therefore the ping has to be sent from 
same process.

Cheers,
Daniel

-- 
Daniel-Constantin Mierla
* http://www.asipto.com/




More information about the sr-dev mailing list