内容简介:参考:今天我们的服务器的自我检测程序停掉了.原因很有意思,mysql 的最大连接数超过了上线, 报错.
参考: https://serverfault.com/questions/408845/what-value-of-thread-cache-size-should-i-use
今天我们的服务器的自我检测程序停掉了.
原因很有意思,mysql 的最大连接数超过了上线, 报错.
结局办法: (修改配置文件之后记得重启)
修改 mysql 的配置 (/etc/mysql/my.cnf ) 设置
[mysqld]
max_connections = 2000
或者更高.
另外, thread_cache_size 也需要设置, 设置办法:
1. 查看3个参数;
mysql> show global status like 'Connections'
-> ;
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| Connections | 368 |
+---------------+-------+
mysql> show global status like 'Threads_created';
+-----------------+-------+
| Variable_name | Value |
+-----------------+-------+
| Threads_created | 181 |
+-----------------+-------+
mysql> show global status like 'Max_used_connections';
+----------------------+-------+
| Variable_name | Value |
+----------------------+-------+
| Max_used_connections | 152 |
+----------------------+-------+
然后, Threads_created / Connections 如果 > 0.01 那么 就需要增加 thread_cache_size
thread_cache_size 必须要高于 Max_used_connections .
以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网
猜你喜欢:- [CentOS7]redis设置开机启动,设置密码
- hadoop地址配置、内存配置、守护进程设置、环境设置
- OpenMediaVault 设置
- scrapy代理的设置
- jvm的参数设置
- perl 国际时区设置
本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
Designing Data-Intensive Applications
Martin Kleppmann / O'Reilly Media / 2017-4-2 / USD 44.99
Data is at the center of many challenges in system design today. Difficult issues need to be figured out, such as scalability, consistency, reliability, efficiency, and maintainability. In addition, w......一起来看看 《Designing Data-Intensive Applications》 这本书的介绍吧!