查看mysql数据库连接数、并发数相关信息
mysql> show status like 'Threads%';
+-------------------+-------+
| Variable_name | Value |
+-------------------+-------+
| Threads_cached | 58 |
| Threads_connected | 57 | ###这个数值指的是打开的连接数
| Threads_created | 3676 |
| Threads_running | 4 | ###这个数值指的是激活的连接数,这个数值一般远低于connected数值
+-------------------+-------+
| Variable_name | Value |
+-------------------+-------+
| Threads_cached | 58 |
| Threads_connected | 57 | ###这个数值指的是打开的连接数
| Threads_created | 3676 |
| Threads_running | 4 | ###这个数值指的是激活的连接数,这个数值一般远低于connected数值
+-------------------+-------+
Threads_connected 跟show processlist结果相同,表示当前连接数。准确的来说,Threads_running是代表当前并发数
这是是查询数据库当前设置的最大连接数
mysql> show variables like '%max_connections%';
+-----------------+-------+
| Variable_name | Value |
+-----------------+-------+
| max_connections | 1000 |
+-----------------+-------+
+-----------------+-------+
| Variable_name | Value |
+-----------------+-------+
| max_connections | 1000 |
+-----------------+-------+
可以在/etc/my.cnf里面设置数据库的最大连接数
[mysqld]
max_connections = 1000
相关推荐
pigsmall 2020-11-19
SXIAOYI 2020-09-16
linuxprobe0 2013-04-01
83560193 2013-06-25
kidneybeans 2013-06-17
加菲猫园 2013-06-16
年轻就要对味 2014-07-11
稻草人的高粱地 2014-07-02
smilebestSun 2014-06-12
xusong 2014-05-17
zfszhangyuan 2013-09-12
80183053 2013-09-12
gaozhlzh 2013-09-11
87453169 2014-01-17
Tom天天 2013-07-12
graseed 2020-10-28
jinhao 2020-09-07
yoohsummer 2020-06-01
impress 2020-02-20
chenshuixian 2013-06-01
羽化大刀Chrome 2013-05-31