firstclass Posted May 16, 2013 Posted May 16, 2013 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
Sove Posted May 17, 2013 Posted May 17, 2013 Are you sure all your mysql connections are properly closed when they are not needed? Failing to do that is the most common reason for that error.
firstclass Posted May 17, 2013 Author Posted May 17, 2013 I don't think that can be the problem, they are closed in the php files, but should auto-close at the end of the PHP anyhow. NOTHING shows up when using "SHOW PROCESSLIST" except that command itself.
Krydos Posted May 17, 2013 Posted May 17, 2013 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.
firstclass Posted May 18, 2013 Author Posted May 18, 2013 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?
Shinryuu Posted May 18, 2013 Posted May 18, 2013 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.
firstclass Posted May 20, 2013 Author Posted May 20, 2013 So any more suggestions? I'm guessign I'm right and it's a global connection limit that's getting exceeded.
firstclass Posted May 21, 2013 Author Posted May 21, 2013 See first post, Stevie. I've made a change today that I hope will make a difference... time will tell.
Krydos Posted May 21, 2013 Posted May 21, 2013 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.
firstclass Posted May 23, 2013 Author Posted May 23, 2013 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.
firstclass Posted May 25, 2013 Author Posted May 25, 2013 Happened a couple of times again today. Again while the server was very slow, even when I have no other online users.
Gourlaykid Posted July 1, 2013 Posted July 1, 2013 My site has being going down frequently recently with the error from MySQL "Too many connections", also I noted that there was a high load on Steve and I wondered if this was the problem
firstclass Posted July 1, 2013 Author Posted July 1, 2013 Having spent a month or so without seeing this ugly error, its back with a vengeance today. All connections are closed, none are permanent. Back to the same old suspicions - this is not my site.
Krydos Posted July 1, 2013 Posted July 1, 2013 I noted that there was a high load on Steve and I wondered if this was the problemProbably. High load affects mysql and ftp more than other services like http.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now