mysql went down after ab test

September 5, 2013 1.9k views
Hi, After testing the sites hosted on Digital Ocean using ab, MySql goes down and cannot connect to the database. It happens every time and I need to start the MySql service. Is there anyone who knows the reason and how to prevent this? Thanks, Nay
3 Answers
MySQL is running out of memory. Try upgrading your droplet or adding swap:
by Etel Sverdlov
Linux swaps allow a system to harness more memory than was originally physically available. Here's how to set up a linux swap file on Ubuntu 12.04
Did some load testing today and had the same issue. I was watching the resources with htop in realtime during the test and saw CPU load, memory usage went to max, then filling out the swap. Finally, mysql crashed at some point, as expected. As soon as the stress test ends, memory/cpu usage goes down. The only problem - mysql is offline. Is there any way to restart (start in this case) mysql service automatically?
If MySQL is crashing even with swap activated, I think it's time to upgrade your droplet. Anything other than that will only affect performance.
Have another answer? Share your knowledge.