[Rails] What to do about "Too many connections"

What do you do when MySQL complains about “Too many connections”? It seems you can just restart mysql (/etc/init.d/mysql restart), and the Rails processes will simply establish new connections transparently, with no requests lost at all.



This happens every few months for me. It seems that when I use switchtower to reap my FastCGI processes, they’ll leave the connections behind. Not sure if there’s a way to make them close them first, or if it only happens when a process crashes.

2 comments

Mark Aufflick
 

I have used mysql for two projects in my entire career, and that's two too many ;)
Read more
Read less
  Cancel
Mark Aufflick
 

Further to your recent post, a rock solid RDBMS is, in my opinion, not one of those things that "just doesn't matter".
Read more
Read less
  Cancel

Leave a comment