Home Forums Tech Database MySQL on Amazon Linux crashes frequently

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #5688
    Udar Gromov
    Keymaster

    Environment:
    – Amazon t2.small Linux instance with 2GB of memory
    – Apache 2.4
    – MySQL 5.6

    Problem:
    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.

    Solutions:
    -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?

    tail /var/log/mysqld.log
     Output last 10 lines of the log (works only if service is running)
    ls /etc/init.d/
     List all services
    service mysqld restart
     Restart MySQL
    free -m
    Display total/used/free memory info

     

    
    

    RE: 2018-06-23 SA

Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.