• /
  • /

Troubleshooting Frequent MySQL Restarts

SEPT 02, 2024 • WRITTEN BY ROMAN AGABEKOV
Frequent MySQL database restarts can degrade system performance. Each restart resets MySQL’s caches and buffers, causing a temporary slowdown as data is reloaded. To troubleshoot this problem, try the following steps:
Step 1: Check for Unapplied Recommendations
Verify that all Releem recommendations have been fully applied. If any are unapplied, you should click Apply.
Step 2: Check for Cron jobs
If the MySQL Metrics chart shows frequent restarts occurring at regular interals or specific times without RAM utilization reaching its maximum, a cron iob might be responsible for restrating the database. Review and check any scheduled cron jobs on the server.
Step 3: Investigate OOM-Killer Events
If restarts coincide with RAM reaching maximum capacity and SWAP memory being used, the issue may be related to the oom-killer forcibly terminating MySQL processes due to insufficient memory.
To confirm, run the command:
journalctl | grep “Out of memory”
If this is the problem, you’ll see an output that looks something like this:
kernel: Out of memory: Kill process 3639 (mysqld) score 850 or sacrifice child
To resolve this problem, reduce the Memory Limit value in Releem server settings to 10% of RAM.
Step 4: Review Logs for Additional Errors or High CPU Utilization
If restarts occur despite ample free RAM, other issues may be present. To diagnose:

  1. Check the error log via the Server settings popup window.
  2. Review the system log at the time of the restart with the journalctl command.

If you find that CPU utilization is high, this could be a sign of excessive query load or inefficient queries.
Consult Releem’s Query Analytics block on the dashboard to identify problem queries.
WRITTEN BY ROMAN AGABEKOV
Ready to dive in?
Try Releem today for FREE! No credit card required.