MySQL使用show status like '%Thread%'
,得到如下显示:
+---------------------------+-------+
| Variable_name | Value |
+---------------------------+-------+
| Delayed_insert_threads | 0 |
| Slow_launch_threads | 0 |
| Threads_cached | 23 |
| Threads_connected | 399 |
| Threads_connected_reserve | 91 |
| Threads_created | 2173 |
| Threads_running | 3 |
+---------------------------+-------+
关于这个显示,有一些疑问。我的问题如下:
你的理解错了
Threads_cached:
The number of threads in the thread cache. This variable was added in MySQL 3.23.17.
Threads_connected:
The number of currently open connections.当前打开的连接数
Threads_created:
The number of threads created to handle connections. If Threads_created is big, you may want to increase the thread_cache_size value. The cache miss rate can be calculated as Threads_created pided by Connections. This variable was added in MySQL 3.23.31.
Threads_running:
The number of threads that are not sleeping.当前未挂起的连接数
MYSQL官方解释http://dev.mysql.com/doc/refman/4.1/en/server-status-variables.html#statvar_Threads_connected