Too Many Data base Connections

Permalink
I am using the latest version of concrete5 with php 7.0
I installed a new site and am using a map add on that fetches data from the data base regularly as prompted by the user.
I recently got this error: "SQLSTATE[HY000] [1040] Too many connections"
Anyone have any ideas as to what could cause this type of error?

The whole site would go blank with just this error on the screen. After a few minutes it would work again. Are there C5 limitations? Can such an error be caused by a shared server? Anything would help, thanks!

 
MrKDilkington replied on at Permalink Reply
MrKDilkington
Hi 10317976,

It looks like a few things could cause this, like resource limited shared hosting or add-on code that makes unnecessary database connections.
https://dev.mysql.com/doc/refman/5.6/en/too-many-connections.html...

Is this a custom add-on?
10317976 replied on at Permalink Reply
Yes this is a custom add on I have been working on with a developer for over a year. It started with one developer and now we are trying to clean it up and make it function correctly.

Thank you for that link. We will look into those items.
MathiasB replied on at Permalink Reply
MathiasB
Hey Karl,
I have got the same error since a couple of days. It appears and after a couple of refreshes (F5) the site works fine again. The hosting company says that it is "my problem". And I also think so, cause al my other C5-Sites are working.
But I cannot spot the culprit. Even a complete backup (ftp and db) couldn't help it.

Best Mathias
Parasek replied on at Permalink Reply
Parasek
fetches data from the data base regularly as prompted by the user.

What do you mean by that?
It fetches data when user is visiting your site?
Or it regularly fetches data by CRON command / refresh meta tag / ajax script every couple minutes?
If latter and if you are doing it without proper caching - I can imagine, you will reach sql limits very fast.
Gondwana replied on at Permalink Reply
Gondwana
I've you've got access to CPanel, see if you can find site load stats/graphs. I think 'number of connections' is sometimes available.

Perhaps your site is getting too popular!
MathiasB replied on at Permalink Reply
MathiasB
Solved!
It was a problem with the installation of a new "DEBIAN" version by the hosting company. They forgot to increase the maximum number of connections. Now the did it. They promised me, the error message will no appear any longer. Let's see...