Jump to content

Max_User_Connections Variable Change


chanders

Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...