Jump to content

[Answered] Mysql Too Many Connections


firstclass

Recommended Posts

Hi all,

 

my game is having a nice little test with ~30 users but we are regularly suffering from errors with "Too many connections" to mySQL... this is happening when I am the only user and so I don't believe can be a result of our site activity... "SHOW PROCESSLIST" shows no running processes.

 

Is there a global stevie wide connection limit that is regularly getting exceeded? If not any ideas why we are getting this

Link to comment
Share on other sites

Are you using persistent mysql connections? It's always a good idea to explicitly close any mysql connections as soon as you no longer need them. Relying on php garbage collection to close the connections for you can result in wildly varying results.

Link to comment
Share on other sites

As I said I believe ALL connections are closed by our scripts, I've tried the switch to persistent connections but I expect the same result.

 

I'm still left suspicious:

Is there a global stevie wide connection limit that is regularly getting exceeded?
Link to comment
Share on other sites

I've tried the switch to persistent connections

 

Persistent connections are bad, please refrain from using them. Krydos asked if you were using them because they tend to be the cause of such problems, not the solution.

Link to comment
Share on other sites

Is there a global stevie wide connection limit that...

Wow, I've read that post probably ten times and always read it as "global server wide" each and every time. Here's to seeing what you expect to see instead of what is actually there. With over 4000 posts I admit I probably skim over things a bit faster than I did when I had less than 100 posts.

 

The reason I'm hesitant to change any settings is because the settings are the way they are to help prevent abuse from one account. If we let one account go nuts and overuse mysql then the other several thousand accounts on the same server would have poor performance. What makes the one account so much more important that the other thousands? We all pay the same amount for the hosting here.

 

Furthermore, I have raised the limits before, but usually when the limits need to be raised we have 2-20 people on here at the same time complaining about the same errors. Remember what I said about thousands of accounts? Why are all of those other accounts, the majority of which use mysql too, not having any issues with the current settings, but you (and only you) are? Sure, some people are never going to report a single error with their website, and some people report an error each time they sneeze and there is a spot on their screen, but those are outliers on the bell curve.

 

Anyways, let us know if your most recent change solves things or if it doesn't. I'm willing to tweak the settings for you a little, but it's best to make sure you aren't doing something odd first before potentially breaking the whole server.

Link to comment
Share on other sites

I've not seen it for a day or 2. And I found a bug in the code that potentially opened multiple (never more than 3) connections and only closed one of them (they all had the same identifier!) That can't happen now, hopefully that was the cause of the issues.

 

But this forum isn't the most active place, it's difficult to know If I'm alone with the errors, particularly when they last for ~10 seconds (even if regularly), if no-one spots, or reports or does so here.

Link to comment
Share on other sites

  • 1 month later...

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