All of a sudden, I started seeing random timeouts and occasional total hangups on a Magento deployment I’m running.
The MySQL server runs on the same machine as the web host, so there shouldn’t be any connectivity issues.
This was solved by editing /etc/mysql/my.cnf and commenting out the line:
bind-address = 127.0.0.1
Then running sudo service mysql restart.
But, I ended up undoing these changes when I realized that the server itself was critically short on RAM. Allocating more RAM seemed to solve the problem as well, and more reliably.