mysql> show variables like 'max_connections'; +-----------------+-------+ | Variable_name | Value | +-----------------+-------+ | max_connections | 151 | +-----------------+-------+ 1 row in set (0.03 sec) mysql> show global status like 'max_used_connections'; +----------------------+-------+ | Variable_name | Value | +----------------------+-------+ | Max_used_connections | 1 | +----------------------+-------+ 1 row in set (0.19 sec)
secureCRT在打开一个窗口 mysql -uroot -p 登陆
mysql> show global status like 'max_used_connections'; +----------------------+-------+ | Variable_name | Value | +----------------------+-------+ | Max_used_connections | 2 | +----------------------+-------+ 1 row in set (0.01 sec)
MySQL比较理想的最大连接数计算方式为:
1
|
max_used_connections / max_connections * 100% ≈ 85%
|