I try to change a global varibale in MySQL

I conenct under root to mysql and enter :

SET GLOBAL wait_timeout = 60;

SET SESSION wait_timeout = 60;

but when I look at


I still have a wait_timeout set to 28800 which is the default value

I also tried to update this value through the my.cnf file but the pbm is the same.

So I’ve googled wait_timeout and I found this in the mysql website

When MySQL is compiled from ports collection with LinuxThreads (2.2.3_12) under
FreeBSD 5.0 RELEASE, wait_timeout parameter gets ignored. This is valid both
setting value in my.cnf or from command line (SET GLOBAL wait_timeout).

I heard that same issue is with other versions of mysql (both 4.0.x and 3.23.x
releases) as well as different versions of FreeBSD.

This bug causes persistent connections to hang for a long time.

But my box isn’t FreeBSD release

Any idea ?


I’ve set the interactive_timeout rather than wait_timeout and now it is ok


In fact even if the show Variables did show that the wait_timeout was set to 60, the show processlist; did show us that the value taken in account was still 28 800

| 5290 | xxxxx | localhost | xxxxx | Sleep | 28579 |
| 5394 | xxxxx | localhost | xxxxx | Sleep | 28206 |
| 5529 | xxxxx | localhost | xxxxx | Sleep | 27461 |
| 5653 | xxxxx | localhost | xxxxx | Sleep | 26853 |
| 5999 | xxxxx | localhost | xxxxx | Sleep | 25915 |

In fact to take in account this value wa had to comment, in my.cnf the line



Now our cpu usage is lesser than before and same for the load average.

The thread_cache_size and wait_timeout value may really help when you have a very busy MySQL server.

Also do not forget to always have a max_connections set higher than the one set in httpd (256 by default).
By default in mysql the max_connexion is set to 100. You should change it to 300 by example

Every comments are as usual welcome