Mysql wait_time out
Hi guys,
We have a few shared hosting servers and have just been reading up on tuning mysql performance. Shared hosting companies seem to have their wait timeout set to 60 seconds. Is this normal? Do you all follow this amount?
When I run to check what ours are I get this?
MariaDB [(none)]> SHOW VARIABLES LIKE 'wait_timeout';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| wait_timeout | 28800 |
+---------------+-------+
1 row in set (0.00 sec)
Is this possible why one of our servers run out of mysql connections randomly? atleast once a week I notice.
Thanks
-
I've set it to 60 seconds: MariaDB [(none)]> SHOW VARIABLES LIKE 'wait_timeout'; +---------------+-------+ | Variable_name | Value | +---------------+-------+ | wait_timeout | 60 | +---------------+-------+ but I still see this after reloading mysql: Id | User | Host | db | Command | Time | State | Info | Progress | +------+---------------+-----------+--------------------+---------+------+-------+------------------+----------+ | 2 | dbname_wp | localhost | dbname_wordpress | Sleep | 84 | | | 0.000 Shouldn't they be killed at 60 seconds ? 0 -
Hello, Did you set the variable "interactive_timeout" as well ? This also affects connections. But I will suggest you to use mysql_close function in your scripts instead of lowering the timeout. Lowering this value to 60 could cause issues to busy websites. 0 -
It's a shared hosting server. What do you recommend. We had all ours on the default of 28800 so we want to fix this and set it properly but not affect our customer sites. What do your recommend. I noticed some put theirs even at 20s. But we'd rather not go that route. 60 or 120? o r higher? 0 -
Hello :) Have you considered running a MySQL tuner and seeing if it suggests changing the wait_timeout value? Thank you. 0
Please sign in to leave a comment.
Comments
4 comments