Server quits silently with MariaDB setting wait_timeout < 1620 and DB Server restart

mardi 22 septembre 2015

--- Steps to reproduce: ---

in /etc/mysql/my.cnf set wait_timeout less than 1620, eg.:

wait_timeout = 60

restart mysql and restart teamspeak server

the teamspeak server will silently stop after one minute without leving anything in the logs.
(the same silent quit also happens everytime the mysql server is restarted :( even if the server is just idleing without any clients connected.)


--- Enviroment: ---

Debian Jessie (current stable) MariaDB 10.0.20

ldd libts3db_mariadb.so
linux-vdso.so.1 (0x00007ffe91fdc000)
libmariadb.so.2 => /usr/lib/x86_64-linux-gnu/libmariadb.so.2 (0x00007fdf7a25e000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fdf79f5d000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fdf79bb4000)
/lib64/ld-linux-x86-64.so.2 (0x00007fdf7a7a6000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007fdf79999000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fdf7977c000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fdf79578000)
libssl.so.1.0.0 => /usr/lib/x86_64-linux-gnu/libssl.so.1.0.0 (0x00007fdf79318000)
libcrypto.so.1.0.0 => /usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.0 (0x00007fdf78f1d000)


--- Expected Behaviour: ---

If the MariaDB Server closes the connection after some timeout, tss3 should reconnect.

If the MariaDB Server is gone (e.g. for a restart) tss3 should also try to reconnect (but after a few seconds) some information in the logs before quitting would also be very nice.

(Alternatively tss3 could keep the connection alive by doing a "SELECT 1", every 30 seconds but this would not help on the mysql restart issue)


--- Background: ---

On a server with some websites, mail/ftp users using mysql e.g. for authentication and recipient maps it can happen that there are many open connections with most of them just sleeping. In order to reduce the number of sleeping connections it is a best practice to lower the wait_timeout to something smaller than the default of 28800 (8 hours) instead of just rising the max_connections limit. Having the timeout at e.g. 600 seconds is a reasonable good value on such a system, or on busy servers (e.g. with websites leaving lots of unused mysql connections open) it may also be wise to set it even lower to prevent DOS.
Server quits silently with MariaDB setting wait_timeout < 1620 and DB Server restart

0 commentaires:

Enregistrer un commentaire