Page 1 of 1

PHP Mysql Database error. Site Crashing or running VERY slow.

Posted: Fri Sep 08, 2017 7:24 am
by LEDStrobeCity
I have 3 web sites on my hosting account and they have been working just fine for years and now I installed opencart into two separate folders on my server (One is my live site and one is a test site) and I have started the past few days to notice when I try to visit ANY of my websites (not just the opencart sites) that they will take a VERY long time to load (5 minutes) or they won't load at all. If I wait about an hour and try again they will load fine but after I click on a few links it starts to slow down and finally not load at all. What could be causing this?
When I go to the error log inside opencart I find a list of errors but it is the same 2 errors repeated over and over. They are:
2017-08-31 14:53:46 - PHP Warning: mysqli::mysqli(): (08004/1040): Too many connections in /home1/public_html/system/library/db/mysqli.php on line 7
2017-08-31 14:53:46 - PHP Warning: DB\MySQLi::__construct(): Couldn't fetch mysqli in /home1/public_html/system/library/db/mysqli.php on line 10

Re: PHP Mysql Database error. Site Crashing or running VERY slow.

Posted: Fri Sep 08, 2017 7:46 am
by MrPhil
What version of OpenCart? If it's not 3.0.x, report this thread and ask that it be moved to the appropriate section.

Re: PHP Mysql Database error. Site Crashing or running VERY slow.

Posted: Fri Sep 08, 2017 8:44 am
by LEDStrobeCity
Version 3.0.2.0

Re: PHP Mysql Database error. Site Crashing or running VERY slow.

Posted: Fri Sep 08, 2017 10:20 pm
by grgr
You might want to upgrade your web hosting to something a little better.

Re: PHP Mysql Database error. Site Crashing or running VERY slow.

Posted: Sun Sep 10, 2017 7:15 am
by LEDStrobeCity
Could this issue be happening due to me having 4 websites running on the same shared hosting account? I did just have 2 websites and they ran perfectly fine but when I added the 2 opencart sites (1 live site and 1 test site) this is when I started having the problems. If I deleted the other 2 sites off my account would that fix the issue or is this something much deeper?

Re: PHP Mysql Database error. Site Crashing or running VERY slow.

Posted: Sun Sep 10, 2017 9:51 pm
by MrPhil
If you're getting messages about "too many connections", see if there is a configuration setting in your stores to restrict them to a single DB connection at a time. It might be named "pconnect" or something similar. If that doesn't help, you may just be overburdening your server and need to upgrade to a more capable system, or split your work across multiple servers.