Dozens of "too many connections" have recently been appearing daily. I've seen that some users are able to use functions on the website just fine, while some other users cannot - even when testing at the same time (I can perform an action, but my friend cannot and generates this error). Even if immediately after I ran 'FLUSH TABLES', my friend was still not able to perform the action and continued to generate the error. I was hoping someone here could give it a look to see what I'm missing - any advice would be greatly appreciated!
my.cnf settings: (commented with # and the suggested formula I found)
Few results from SHOW GLOBAL STATUS: (I last restarted MySQL (v5.6) about 2 days ago)
asked 04 Nov '17, 21:34 skateproject |
It sounds like a bug in your code more than an issue in configuration. I suggest enabling SQL logging and trying to isolate which queries are being called and make sure you code is closing the connection after it is done obtaining the data. answered 04 Nov '17, 23:23 johns @Johns Thank you for making that point. I've made some revisions in how queries were called and eliminated a number of redundancies. I haven't seen the 'too many connections' errors since.
(12 Nov '17, 19:18)
skateproject
Glad to hear it helped. For posterity what lead me to that conclusion was the number of connections. It should be more in line with the number of concurrent HTTP connections, 300 concurrent HTTP connections/queries per request, would be a high number for most services we host. If you are hosting about that number of HTTP concurrent connections and you can't slim it down with caching or clever queries based on the least per request then you should increase the number.
(12 Nov '17, 20:45)
johns
|