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