– Amazon t2.small Linux instance with 2GB of memory
– Apache 2.4
– MySQL 5.6
Amazon Linux instance launched in October 2017. Starting from December 2017 MySQL would crash and require a restart once every month. Starting from mid-June 2018 MySQL would start crashing daily, then several times a day.
-01- [COMMON] Create and enable large swap file to allow access to virtual memory – that did not work. MySQL crashed within 6 hours of enabling swap file.
-02- [PROUD] Create a new section <IfModule mpm_prefork_module> in Apache “httpd.conf” file to limit simultaneous web users consuming all the memory.
Proud moment occurs when an obscure insurmountable problem slowly turns into an interesting research project, then into an action plan, and finally into a solution.
Please see, if this will be an interesting topic to discuss.
Linux commands used to diagnose and fix the problem:
Examine mysqld.log to see why MySQL is crashing. Is it a memory problem?
Output last 10 lines of the log (works only if service is running)