mysql - MySQL“连接”显示的数字太高 - 显示状态
问题描述
我们的网站每天访问量很大,数据库上有很多写入和读取。我们正在运行 InnoDB 和 Laravel,使用以下命令:
show status like 'Conn%';
显示我们有199641163个连接,而且这个数字一直在增加,我只想知道这是否正常!?
解决方案
show status like 'Conn%'; This does not show active connections,it means the total number throughout history.
to check active connection you can use
SHOW STATUS WHERE `variable_name` = 'Max_used_connections';
or
show status where `variable_name` = 'Threads_connected';
In order to check the maximum allowed connections,
SHOW VARIABLES LIKE "max_connections";
推荐阅读
- c - 来自 stdlib.h 的 qsort() 未对包含邮政编码和相应城市的指定结构进行排序
- javascript - Firestore 云函数递归更新子集合/集合组
- r - 在应用程序中的 if() 之后处理 NULL
- c# - 代理模式和存储库模式有什么区别
- excel - Excel:每个大陆的总人口总和(使用 Excel 公式 - 没有 Pivot)
- r - 在列之间重新排序个人 ID
- java - 为什么在 iText5 和 iText7 之间提取文本的位置不同?
- ssl - 为什么 OpenSSL 工具可以成功验证未签名的文件?
- django - 如何访问和设置任何生产环境变量(Nginx 和 Gunicorn)
- mysql - 在mysql中的联合表上缓慢删除