mysql went down after ab test

Posted September 5, 2013 3.6k 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

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
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.