首頁  >  文章  >  資料庫  >  MySQL的wait_timeout_MySQL

MySQL的wait_timeout_MySQL

WBOY
WBOY原創
2016-06-01 13:11:14951瀏覽

没有修改过MySQL的配置,缺省情况下,wait_timeout的初始值是28800

wait_timeout过大有弊端,其体现就是MySQL里大量的SLEEP进程无法及时释放,拖累系统性能,不过也不能把这个指设置的过小,否则你可能会遭遇到“MySQL has gone away”之类的问题

mysql> set global wait_timeout=20;

mysql> show global variables like 'wait_timeout';
+----------------------------+-------+
| Variable_name              | Value |
+----------------------------+-------+
| wait_timeout               |20    |
+----------------------------+-------+


今天发现很多sleep的进程,mysql给出的原因为3个:


1 The client program did not call mysql_close() before exiting. 

2 The client had been sleeping more than wait_timeout or interactive_timeout seconds without issuing any requests to the server. 

3 The client program ended abruptly in the middle of a data transfer 

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn