Jump to content

Recommended Posts

Posted

The main reason people get that error is because they don't close their mysql connections properly. In fact you've got an open mysql connection right now that's been open for almost 3 hours without sending a single byte of data! I closed it for you. Some of the websites that we host get 10s of thousands of views per day and don't see that error because their code is well written and each mysql connection is only open for a few milliseconds each time. Let us know if you need help figuring out the code to close your connections, and also let us know if you see that error again so we can close your open connections again for you.

Posted

Dear Krydos,

 

Thank you for the great suggestion -- apparently the current global variable: max_user_connections is set to 4 -- which might just be too low!. Also, I checked my code and it seems that: I open the pooled connection instance -- process sql-- and then immediately close it right after the operation. So, most of the time it seems to work, but annoying stops or slows down causing data access errors. Most people suggest changing the global max_user_connections first, before changing the pooling scheme or anything else. So temporarily changing this global variable higher will prove this hypothesis. Besides this global variable change does not affect the system resources much, since the top limit is already set to 75.

 

at: /home/citisnet

warm regards.

Posted

Besides this global variable change does not affect the system resources much, since the top limit is already set to 75.

There are over 1000 accounts on your server. If each account had 4 open connections that would be over 4000 open connections at once. The reason the limit is so low is to prevent one person from hogging all the resources leaving no one else able to connect. The other thing you could do is benchmark your queries to see how long they're taking in milliseconds and rewrite/optimize your code to run faster.
Posted

Thanks krydos - good point and again a good suggestion! My guess is that there may be system delay in closing a pooled connection (due to pooled connection queue delays), which makes the connection count Temporarily exceed 4 (max allowed) rather too quickly. Regards.

Posted

I don't mind increasing the max_connections value for you if you really need it, but we should make sure that the code is solid first.

Posted

Thanks Krydos, I would certainly appreciate if it is possible to temporarily increase it so I can do some benchmarking without butting into system queue delays. I can assure you that I am very carefully with regards to monitoring, and ensure that the pooled connection is closed immediately after operation is completed. Thanks again and warm regards.

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...