Mathieu Bruneau <rounoff 'at' gmail.com> writes:

> 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 think this is not really correct. MySQL purposedly closes idle
connections with your wait_timeout setting, so except if you
think it's bad to close idle connections (and you change your
wait_timeout setting), closing idle connections is fine.

However, crashing Kannel on database unavailability (e.g. more
precisely than just not being able to store the DLR on random db
error) is of course not good and this should probably be fixed
(can you contribute that?).

That said, if your database runs out of available connections,
then you're really in trouble. I doubt only Kannel will have a
problem on that (I mean, in the best case then you're unable to
service your clients anyway, in the worst case other applications
will crash as well - so really you want to implement something to
prevent from opening that many connections, some kind of requests
queueing etc).

> I see 2 possible solutions:
> 1 - Have a timer that exec the mysql_check every n seconds (Configurable of
> course)

It really defeats the wait_timeout setting. If you're unhappy
with wait_timeout (or would like to have it per-connection) then
this should really be changed/fixed on DB side.

> 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)

And what if you have no Kannel activity for 8 hours? In the
mentioned doc it's not very clear if that can be deactivated,
which may be a solution.

Disclaimer: I'm not a heavy pgsql user, very little experience
with mysql.

-- 
Guillaume Cottenceau

Reply via email to