当前位置: 动力学知识库 > 问答 > 编程问答 >

php - mysql - Too many connections error cause

问题描述:

I am currently getting the two below errors on a LAMP server running Ubuntu 14.04.

Warning: mysqli::mysqli(): (HY000/1040): Too many connections in /var/www/html/classes/Db.class.php on line 17

Fatal error: Database connection failed: Too many connections in /var/www/html/classes/Db.class.php on line 23

A few things worth mentioning.

  • I was running a few cron jobs with wget (changed to curl) which created over 1000 files in root(should I delete them?)
  • After I restarted the server the errors are still present
  • I checked the mysql max_connections: max_connections | 151
  • I'm pretty sure that I closed the connection after each query. This never happened before setting up those crons.

I have a snapshot of the server from yesterday and it would be very easy to set that up and get rid of the errors, but I would like to know where they are coming from.

So what should I do to get rid of these errors?

分享给朋友:
您可能感兴趣的文章:
随机阅读: