惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Forbes - Security
Forbes - Security
大猫的无限游戏
大猫的无限游戏
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Jina AI
Jina AI
美团技术团队
博客园 - 聂微东
博客园 - 叶小钗
Security Latest
Security Latest
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
博客园_首页
Spread Privacy
Spread Privacy
J
Java Code Geeks
雷峰网
雷峰网
宝玉的分享
宝玉的分享
C
Cyber Attacks, Cyber Crime and Cyber Security
P
Privacy International News Feed
C
CXSECURITY Database RSS Feed - CXSecurity.com
T
Threat Research - Cisco Blogs
The Hacker News
The Hacker News
量子位
L
LINUX DO - 热门话题
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
G
GRAHAM CLULEY
D
Darknet – Hacking Tools, Hacker News & Cyber Security
月光博客
月光博客
腾讯CDC
Last Week in AI
Last Week in AI
人人都是产品经理
人人都是产品经理
酷 壳 – CoolShell
酷 壳 – CoolShell
T
Tor Project blog
罗磊的独立博客
V
Vulnerabilities – Threatpost
Apple Machine Learning Research
Apple Machine Learning Research
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
有赞技术团队
有赞技术团队
Project Zero
Project Zero
Hugging Face - Blog
Hugging Face - Blog
爱范儿
爱范儿
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
T
Tenable Blog
MyScale Blog
MyScale Blog
T
The Exploit Database - CXSecurity.com
GbyAI
GbyAI
博客园 - 【当耐特】
O
OpenAI News
Schneier on Security
Schneier on Security
S
Secure Thoughts
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
S
Securelist
博客园 - 司徒正美

Xiaoxia[PG]

nginx的proxy_pass使用https(SSL加密) | Xiaoxia[PG] Python里使用zbar识别二维码 | Xiaoxia[PG] 发现一个不需要打密码的sudo方法 | Xiaoxia[PG] Windows上最小的Python运行环境,700KB | Xiaoxia[PG] 继续玩路由器,交叉编译Python 3.3,压成1.5MB | Xiaoxia[PG] 无聊开始玩路由器,入门Tomato固件 | Xiaoxia[PG] Python与简单网络爬虫的编写 | Xiaoxia[PG] 2012年的中秋节 | Xiaoxia[PG] 悬疑 微电影《生日快乐》/ Once Again | Xiaoxia[PG]
CentOS7上MySQL返回Too many connections | Xiaoxia[PG]
作者是Xiaoxia。 · 2015-11-03 · via Xiaoxia[PG]

被这个问题困扰了一天,今天做微信开发,流量一大,django占用CPU很大,这个比较好解决,加进程加硬件即可。然而数据库连接开始报Too many connections,查了网上一些文章,直接改/etc/my.cnf加入max-connections=3000,无果。又查,在mysql里输入set GLOBAL max-connections=3000,数值是变了,然并卵。

刚才找到一个文章,才想起原来是CentOS7的systemd限制了服务进程的NOFILE,导致每次启动mysql服务后,查询max-connections一直是214,这个数字可能是默认的最大值吧。解决方法如下:

编辑 /usr/lib/systemd/system/mysqld.service,加入:
LimitNOFILE=infinity
LimitMEMLOCK=infinity

困扰整天的问题终于解决,撰文记下。

参考文献:

http://www.nethings.eu/quick-picks/mysql-max-connections/