My Magento website has a separate web server and the database server is different (so basically it's a remote connection). I have a test site as well that has a separate database on same remote database server. Oftentimes I see database disconnection issue in my main Magento store, however my test site works smoothly. What's the issue?

I see Cloudflare error 524 most of the times and when I restart the database server I get "Connection failed: SQLSTATE[HY000] [2002] Connection refused"

After some time, everything starts working fine on it's own. I get any reports in var/Log files.

1 Answer 1


Most likely there are too many open connections between the web and database servers.

These connections (keep-alive PDO) are usually cached in the session data, so you wouldn't notice it for a development site with only minimal activity... but it would greatly affect the total number of customers able to connect at the same time.

  • I see. So what's the solution for the issue?. Commented Nov 19, 2016 at 7:01
  • The easiest is to just restart the MySQL server. See dev.mysql.com/doc/refman/5.5/en/too-many-connections.html. Or if you have permission, you can use SHOW PROCESSLIST to view all connections, and KILL the process ID's you want to kill.
    – Phil M
    Commented Dec 19, 2017 at 18:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.