Jump to content

[Solved] more than 'max_user_connections' active in classes/MySQL.php


Recommended Posts

Help! Since 3-4 days, I have hundred of error entries like the one below in the error log. I don't know what to do to solve this, nor do I have an idea what's causing it. But it's causing me massive performance issues.

 

PHP Warning: mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: User already has more than 'max_user_connections' active connections in /home2/account/public_html/classes/MySQL.php on line 34

 

Help would be much appreciated!

 

Kindly,

 

Dan

Link to comment
Share on other sites

Hi phrasespot,

 

thanks for your reply. Just to be sure I got your answer right, we are talking about the number of simultaneous requests the PS shop can send to the DB engine (like, one shop = one user). Correct?

 

I usually don't have this issue, so I think it must have been some error that caused more requests than usual to be sent, or an error that kept connections open for too long (there were no slow queries in the log though).

 

Thanks, and have a great day!

 

Dan

Link to comment
Share on other sites

we are talking about the number of simultaneous requests the PS shop can send to the DB engine (like, one shop = one user). Correct?

Correct. MySQL has a setting where max simultaneous connections per user is specified (in this case shop itself). When that limit is exceeded said error is given.

 

I usually don't have this issue, so I think it must have been some error that caused more requests than usual to be sent, or an error that kept connections open for too long (there were no slow queries in the log though).

Possible. An over-eager crawler etc may cause such symptoms. You may have a better idea if you corrolate server request logs to the time of error if you continue receiving it.

Link to comment
Share on other sites

Hi phrasespot,

 

thank you again for your reply and explanations, it's much appreciated. I will definitely contact Bluehost and see if the number of connections can be increased, should the error happen again.

 

I was also wondering if there is a list of requirements or optimal settings for running PS? I read on the forum somewhere that the ideal max memory and execution time settings were 256Mb and 60 seconds, but that actually seems to increase the number of slow sql queries in the error log.

 

Do you have any recommendation for me regarding the settings, or where I should look for the optimal configuration for PS1.4 to run?

 

Thanks again, and have a great day!

 

Dan

Link to comment
Share on other sites

it's much appreciated. I will definitely contact Bluehost and see if the number of connections can be increased, should the error happen again.
My experience is that most hosting companies leave it untouched at default setting which is sufficient in the absence of a resource exhaustion attack against the site, badly written crawler or hosted software. If you do have the error again try to determine the cause by looking at the requests processed by the server within same time frame.
I was also wondering if there is a list of requirements or optimal settings for running PS? I read on the forum somewhere that the ideal max memory and execution time settings were 256Mb and 60 seconds, but that actually seems to increase the number of slow sql queries in the error log.
There is the official requirements published in PS main site, plus the various posts you already mentioned. However there is not a single recipe that fits all installations perfectly. To achieve optimum performance each installation must be evaluated individually regarding hardware it is installed on, hosting location, modules/theme used etc, number of products/customers. There is no magic switch. A number of tests must be performed, bottlenecks identified. Then corrective action can be taken.

 

There are some obvious improvements that should be done for every installation/server; some of those are already discussed in various threads here. I may get to collate all that into a coherent document sometime when I have time.

 

Do you have any recommendation for me regarding the settings, or where I should look for the optimal configuration for PS1.4 to run?
As I said, I would need to know a lot more about your setup and spend at least a week with it, run tests etc to give you any decent recommendations. I do offer a service where I guarantee 20-30% improvement (and usually much higher) on any installation or no charge. But my schedule is completely full until mid March. Get in touch nearer that time if you are interested. Edited by phrasespot (see edit history)
Link to comment
Share on other sites

You don't happen to also offer streamlined or efficient templates too, in addition to modules?

No, not generally available ones. Templates are very heavy maintenance (50x compared to a module) due to the way PS is written; styling snippets mixed with business logic everywhere. Either one ends up spending a lot of time re-tuning them with every new release, or worse not spend the time and they rot becoming unusable after a single generation of PS. If done properly, it is a lot of work for very little return so I get tangled with templates only for an established, long term client.

Link to comment
Share on other sites

  • 9 months later...

Hello! How did you get to solve this. I am running Prestashop 1.4.5.1 and all the sudden the website is not accessible, I did not change anything in the past days. I cannot access the frontend or the backend. When I try, I get this:

 

Unknown system variable 'profiling'

SET profiling = 1

 

The last errors on the log file are these:

[18-Nov-2012 11:01:17] PHP Warning: mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: User ****** already has more than 'max_user_connections' active connections in /home2/happydb5/public_html/classes/MySQL.php on line 34

[18-Nov-2012 11:01:17] PHP Warning: mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: User ****** already has more than 'max_user_connections' active connections in /home2/happydb5/public_html/classes/MySQL.php on line 34

[18-Nov-2012 13:00:04] PHP Warning: mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /home2/happydb5/public_html/classes/MySQL.php on line 34

[18-Nov-2012 13:10:45] PHP Warning: mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /home2/happydb5/public_html/classes/MySQL.php on line 34

 

I contacted the hosting provider (bluehost) but they say its not their problem, they say something is wrong in the site. Please help! I have no clue of what is wrong!

 

Any idea is greatly appreciated.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...