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

推荐订阅源

T
Tenable Blog
博客园_首页
Vercel News
Vercel News
WordPress大学
WordPress大学
美团技术团队
G
Google Developers Blog
大猫的无限游戏
大猫的无限游戏
小众软件
小众软件
Y
Y Combinator Blog
博客园 - 【当耐特】
量子位
酷 壳 – CoolShell
酷 壳 – CoolShell
The Cloudflare Blog
T
The Blog of Author Tim Ferriss
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Google DeepMind News
Google DeepMind News
云风的 BLOG
云风的 BLOG
腾讯CDC
M
MIT News - Artificial intelligence
爱范儿
爱范儿
Recent Announcements
Recent Announcements
雷峰网
雷峰网
Last Week in AI
Last Week in AI
宝玉的分享
宝玉的分享
The Register - Security
The Register - Security
Jina AI
Jina AI
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Hugging Face - Blog
Hugging Face - Blog
P
Privacy & Cybersecurity Law Blog
Recorded Future
Recorded Future
Help Net Security
Help Net Security
N
News and Events Feed by Topic
博客园 - Franky
P
Proofpoint News Feed
L
LINUX DO - 热门话题
S
SegmentFault 最新的问题
The GitHub Blog
The GitHub Blog
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
月光博客
月光博客
D
Docker
Google DeepMind News
Google DeepMind News
有赞技术团队
有赞技术团队
IT之家
IT之家
Security Latest
Security Latest
L
LangChain Blog
V
V2EX
阮一峰的网络日志
阮一峰的网络日志
J
Java Code Geeks

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/