开发者社区> 问答> 正文

mysql的show status 中 thread 的含义

MySQL使用show status like '%Thread%',得到如下显示:
1
问题如下:
Threads_connected是不是代表连接池中目前所创建的所有连接?
Threads_running是否代表所创建的所有连接中正在使用的连接?
如果上述理解是正确的,Threads_running很小而Threads_connected很大,是不是说明有很多空闲的 connection?那为何在做并发测试的时候,Threads_connected便直线上升,而不是直接使用空闲的?

展开
收起
蛮大人123 2016-02-07 17:59:36 4535 0
1 条回答
写回答
取消 提交回答
  • 我说我不帅他们就打我,还说我虚伪

    你的理解错了
    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 divided 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/5.7/en/server-status-variables.html#statvar_Threads_connected

    2019-07-17 18:39:17
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
搭建电商项目架构连接MySQL 立即下载
搭建4层电商项目架构,实战连接MySQL 立即下载
PolarDB MySQL引擎重磅功能及产品能力盛大发布 立即下载

相关镜像