Skip to content

MariaDB Keeps Restarting? OOM Killer Diagnosis and Fix on a WordPress Server

On this page

Last updated: · By

Short answer: when MariaDB restarts by itself on a WordPress server, the usual cause is the OOM Killer: a Linux mechanism that kills a process when RAM and swap run out. On my Cloudways server, with 16GB and 36 sites, PHP-FPM took about 2.7GB and MariaDB about 4.5GB until memory ran out. What support did in September 2026: it increased the swap (from 2GB to 4GB) and recommended limiting bots and admin-ajax. On another server of mine it also cut idle PHP-FPM processes from about 112 to 3, which freed about 7.5GB.

⏱ Diagnosis time: 20–40 minutes · Difficulty: advanced · Last checked against my tickets: 7 Nov 2026

This page is based on real support requests I opened with Cloudways: tickets #977464, #978826 and #981625 from September 2026, and #619034 from January 2025. The data, dates and response times are taken from the ticket system’s emails.

Key facts: what I saw in my tickets (September 2026)

The server16GB RAM, 8 cores, about 36 WordPress sites
The symptomTwo MariaDB restarts within 25 minutes (23 Sep), and a restart at the same minute every hour (30 Sep)
Memory use at the moment of the crashPHP-FPM about 2.7GB, MariaDB about 4.5GB, a full 2GB swap
LoadAbout 12 on 8 cores
What triggered itBot traffic, WP Rocket preload, heavy admin-ajax, a flood of 404s for Elementor CSS files
Idle PHP-FPM processes (another server)About 112, cut to 3, freeing about 7.5GB
First response time21 minutes to 3.3 hours

What is the OOM Killer and why does it pick MariaDB?

The OOM Killer (Out Of Memory Killer) is part of the Linux kernel. When there is no free memory left and no room in swap, it picks a process and kills it so the whole server does not crash.

According to the Linux kernel documentation, every process gets a “badness” score between 0 and 1000, roughly based on the share of memory it uses. The database is usually the single largest process on a WordPress server, so it is the first to be killed. Afterwards the management system starts it again, and you see “MariaDB restart”.

That is also the difference from an ordinary connection error. If the site shows Error Establishing a Database Connection for a few seconds and then recovers on its own, suspect OOM. A general walkthrough of that error is in the Error Establishing a Database Connection guide.

What happened to me? The story from the tickets

  1. 29 Jan 2025, ticket #619034: a proactive notice from Cloudways that MySQL had crashed repeatedly because of OOM on a small server. The recommendation was to optimize or add RAM. That was the first signal, and I did not dig into it.
  2. 23 Sep 2026, ticket #977464: two MariaDB restarts within 25 minutes, on a server with about 36 sites and about 108 PHP-FPM processes. Support answered within about 21 minutes and identified the OOM Killer. One site took about 69% of the applications’ memory, because of a flood of 404, 500 and 503 errors on missing Elementor CSS files. The recommendation: regenerate the CSS files and monitor.
  3. 25 Sep 2026, ticket #978826: on another server the swap was 100% full and there were OOM kills. Support found about 112 idle PHP-FPM processes and cut them to 3. That freed about 7.5GB of RAM. First response: about 3.3 hours.
  4. 30 Sep 2026, ticket #981625: MariaDB restarted at the same minute every hour on a 16GB, 8-core server. The load was about 12 and the 2GB swap was full. Support answered within about 50 minutes: PHP-FPM with about 2.7GB and MariaDB with about 4.5GB had used up the RAM and the swap. The triggers were bot traffic, WP Rocket preload and heavy admin-ajax requests. Support increased the swap from 2GB to 4GB, and recommended rate limiting admin-ajax in Cloudflare and slowing down the preload.

The lesson: a crash at the same minute every hour usually points to a scheduled task. In my case support did not name a single cause, but listed several triggers: bots, WP Rocket preload and heavy admin-ajax.

How do I tell that the OOM Killer killed MariaDB?

Look for three things: an OOM line in the kernel log, a full swap in the graphs, and a time that repeats. Four steps, in order:

  1. In the platform, choose the server and open Monitoring. Check the memory and swap graph at the time of the crash. Details are in the guide to server monitoring on Cloudways.
  2. Connect over SSH and run htop. Sort by memory (MEM%) and count how many php-fpm processes are running without working.
  3. If you have permission, search the kernel log: dmesg -T | grep -i -E "out of memory|killed process". A line like Out of memory: Killed process ... (mariadbd) is the proof.
  4. The master user on Cloudways has no root, so the command may not work. In that case ask support for the OOM lines and the per-process memory breakdown, as I did.

Also check application monitoring: a single site that takes a large share of memory, like the 69% on my server, points to the problem.

How do I fix OOM crashes on a WordPress server on Cloudways?

Start by reducing the load, and only then add memory. The table lists what worked for me in order of priority:

ActionWho does itWhat happened to me
Cut idle PHP-FPM processesSupportFrom 112 to 3, about 7.5GB freed
Limit bots and admin-ajaxYou (Cloudflare, Bot Protection)Recommended in ticket #981625
Slow down the cache preloadYou (in the plugin)Recommended in ticket #981625
Fix a site that generates errorsYouRegenerating Elementor CSS
Increase swapSupportFrom 2GB to 4GB
Reduce the InnoDB buffer poolYou, in the platform4096MB was suggested, it stayed at 6144MB
Add RAMYouThe last resort, not the first
  1. Open a support request and write down the crash times. Ask for the OOM lines and memory use per process and per application.
  2. Turn on Bot Protection on Cloudways, and check how much traffic comes from bots. The guide on AI crawler load on your server explains how to limit them.
  3. In Cloudflare, create a rate limiting rule for the path /wp-admin/admin-ajax.php. According to the Cloudflare documentation, the free plan has one rule, counting by IP over a 10-second period. Set a generous threshold, because real visitors use admin-ajax too.
  4. Slow down or turn off the cache preload on large sites, and spread the run times across sites.
  5. Find the site that generates 404 and 500 errors in volume and fix it. In Elementor that is Regenerate Files & Data under Tools.
  6. After a week with no crashes, decide whether you need more RAM. If so, see scaling a server on Cloudways.
Black Friday80% off
80% off 2 months of managed hosting

The code BFCM802 takes 80% off your bill for the first two months (up to $200 off per month), including unlimited free site migrations. New customers only, and only until the offer ends.

The offer ends on December 4, 2026 at 23:59 (UTC+2).

Ends in—days—hours—minutes—seconds
Code:
Grab the 80% now

Start with a free trial, no credit card. Enter the code at checkout and check that it shows up.

After Black Friday: 30% off for 3 months with the code ASAEL. On a large server (above about $444 a month) ASAEL already saves more today. BFCM802 vs. ASAEL calculator

Why is my server full of idle PHP-FPM processes?

PHP-FPM runs “workers”: processes that wait for PHP requests. Every application on the server gets its own pool, and every worker holds memory even when it is doing nothing. On a server with 36 sites this adds up fast.

On my server there were about 112 idle workers. The math: 7.5GB divided by the roughly 109 workers that were closed gives about 70MB per worker (my estimate). On a 16GB server that is almost half the memory, spent on processes that did not serve a single visitor.

According to the PHP-FPM documentation, there are three modes for managing workers:

Mode (pm)How it worksWhen it fits
staticA fixed number of workers, set by pm.max_childrenOne busy site with plenty of RAM
dynamicA variable number, with a minimum of spare workers that always runOne site, or a few sites with steady traffic
ondemandA worker opens only when there is a request and closes after an idle time (default 10 seconds)A server with many small sites

I did not see an option in the platform to change the pm mode. On my server support made the change at the platform level. In the platform you can change PHP settings per application (such as memory_limit), as described in the guide to PHP settings on Cloudways, but not the pm mode.

As for the database: support suggested lowering the InnoDB buffer pool from 6144MB to 4096MB, and the change did not take in that ticket. The MariaDB documentation recommends that the buffer pool hold most of the active data, and warns that too large a size causes swapping. On a multi-site server it is worth finding the balance between MariaDB and PHP-FPM, rather than giving one of them all the memory. How memory is divided on a WordPress server is explained in the guide to how much RAM a WordPress site needs.

Which common mistakes make OOM crashes worse?

Adding RAM right away: if the bots and the preload continue, they will fill the new memory too. Reduce the load first.

Ignoring a proactive notice: the January 2025 message was an early sign. When Cloudways sends an OOM alert, open a ticket and ask for details.

Assuming it is the disk: a full disk also brings MySQL down, and that happened to me separately. Check both, using the guide to full disk and inodes.

Not replying to the ticket: ticket #981625 was closed automatically after reminders. If the problem returns, reply on the same ticket so the history is kept.

What is the checklist for preventing MariaDB crashes?

  • Check the RAM and swap graphs once a month. A swap that is permanently full is a warning.
  • Count idle PHP-FPM workers with htop. If there are dozens, ask support to check the pm settings.
  • Spread scheduled tasks and preloads across sites, and don’t run them all at the same minute.
  • Turn on Bot Protection and rate limiting for admin-ajax.
  • Watch sites that generate a lot of 404 and 500 errors. One site can bring down an entire server.
  • Leave headroom: don’t raise OPcache and the buffer pool until there is no RAM left for PHP-FPM. These settings are covered in the guide to server settings on Cloudways.

Frequently asked questions

Why does MariaDB restart by itself?

The usual cause is the Linux OOM Killer, which kills the largest process when RAM and swap run out. The database is usually the largest process, so it is killed and restarted. On my server it happened with 16GB and 36 sites.

How do I know it is OOM and not another failure?

Look for a line like Out of memory: Killed process in the kernel log, and a full swap in the graphs at the time of the crash. If you don’t have permission to read the log, Cloudways support can pull the lines for you, as it did for me.

Does increasing swap solve the problem?

Only partly. Swap gives you headroom before a crash, but it is much slower than RAM. On my server increasing it from 2GB to 4GB helped, but the real fix was reducing the load and closing idle workers.

What is PHP-FPM ondemand?

A mode where PHP-FPM opens a process only when a request arrives and closes it after an idle time, 10 seconds by default. On a server with many small sites it saves a lot of memory. On my server, cutting idle workers freed about 7.5GB.

Can I change PHP-FPM settings on Cloudways myself?

Partly. In the platform you can change PHP settings for each application, but not the worker management mode. On my server support did that at the server level.

When do I actually need to upsize the server?

After you have removed the load from bots, preload and idle workers and the swap still fills up. If there are still crashes after a week of changes, adding RAM is the right step.

Sources

Official source: How to Monitor the RAM Usage of a Server (Cloudways Knowledge Base). Written and checked by Asael Dreyer · Updated: 7 Nov 2026

Disclosure: this is an independent site, not the official Cloudways site. Some links on this site are affiliate links: if you sign up through them we earn a commission, at no extra cost to you. Full details

Picture of Asael Dreyer
Asael Dreyer

Hi, I'm Asael Dreyer, CEO of an SEO agency that runs hundreds of websites hosted on dozens of Cloudways servers.
Everything you will find here comes from hands-on experience, mine and my teams', straight from the field: from the guides to the recommendations. All to help you get the most out of Cloudways.

More about me →

Need help? Got a question about your server or this guide? Write to us and we will get back to you.

More guides on this topic:
מפריד
Thanks for your message!
We will get back to you soon.
Ready to get started?

Sign up with the coupon code ASAEL