Wait_timeout

We have the variables set to below value but, We still connections in sleep hanging for more than 20K secs. Can you please assist what do we need to look at this point?

mysql> show global variables like ‘%wait_timeout%’;
±-------------------------±---------+
| Variable_name | Value |
±-------------------------±---------+
| innodb_lock_wait_timeout | 600 |
| lock_wait_timeout | 31536000 |
| wait_timeout | 600 |
±-------------------------±---------+
3 rows in set (0.00 sec)

mysql> show global variables like ‘%interactive_timeout%’;
±--------------------±------+
| Variable_name | Value |
±--------------------±------+
| interactive_timeout | 3600 |
±--------------------±------+
1 row in set (0.00 sec)

“wait_timeout” is a tricky one. There are 4 settings – interactive and batch, global and session. And there may be a difference between the server (mysqld), the commandline tool (mysql) and other “clients”. Run those two commands again, but with “session” instead of “global”.