现象
- top查看mysql的内存占用比平时高了很多,到60%多,cpu占用也大
- 经常报 too many connections
解决
- 查看mysql当前连接数量:
// 进入 mysql 内,执行:
mysql> SHOW STATUS LIKE 'Threads_connected';
- 调大mysql的最大连接数:
// 进入 mysql 内,执行:
mysql> SET GLOBAL max_connections = 1000;
- 后来随手检查了下各种硬件资源,发现硬盘满了:
$ df -h
- 然后看了眼 mysql 的日志目录: /var/lib/mysql/
- 上面是已经删了一些,一开始特别多,占了50%的硬盘,直接把旧的日志全删了就好多了:
$ rm binlog.0017*
- 清理后 mysql 就恢复正常了
you are truly a just right webmaster The site loading speed is incredible It kind of feels that youre doing any distinctive trick In addition The contents are masterwork you have done a great activity in this matter
I very delighted to find this internet site on bing, just what I was searching for as well saved to fav
Hi, I’m Jack. Your website has become my go-to destination for expert advice and knowledge. Keep up the fantastic work!
Fantastic site Lots of helpful information here I am sending it to some friends ans additionally sharing in delicious And of course thanks for your effort
This is really interesting, You’re a very skilled blogger. I’ve joined your feed and look forward to seeking more of your magnificent post. Also, I’ve shared your site in my social networks!
you are truly a just right webmaster The site loading speed is incredible It kind of feels that youre doing any distinctive trick In addition The contents are masterwork you have done a great activity in this matter
ฉันไม่ค่อยพบบทความที่มีการค้นคว้าอย่างดี เข้าใจลึกซึ้ง และเขียนได้อย่างสวยงามเช่นนี้ ยอดเยี่ยม!