Last updated: · By Asael Dreyer
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 server | 16GB RAM, 8 cores, about 36 WordPress sites |
|---|---|
| The symptom | Two 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 crash | PHP-FPM about 2.7GB, MariaDB about 4.5GB, a full 2GB swap |
| Load | About 12 on 8 cores |
| What triggered it | Bot 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 time | 21 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
- 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.
- 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.
- 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.
- 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:
- 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.
- Connect over SSH and run
htop. Sort by memory (MEM%) and count how many php-fpm processes are running without working. - If you have permission, search the kernel log:
dmesg -T | grep -i -E "out of memory|killed process". A line likeOut of memory: Killed process ... (mariadbd)is the proof. - 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:
| Action | Who does it | What happened to me |
|---|---|---|
| Cut idle PHP-FPM processes | Support | From 112 to 3, about 7.5GB freed |
| Limit bots and admin-ajax | You (Cloudflare, Bot Protection) | Recommended in ticket #981625 |
| Slow down the cache preload | You (in the plugin) | Recommended in ticket #981625 |
| Fix a site that generates errors | You | Regenerating Elementor CSS |
| Increase swap | Support | From 2GB to 4GB |
| Reduce the InnoDB buffer pool | You, in the platform | 4096MB was suggested, it stayed at 6144MB |
| Add RAM | You | The last resort, not the first |
- Open a support request and write down the crash times. Ask for the OOM lines and memory use per process and per application.
- 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.
- 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. - Slow down or turn off the cache preload on large sites, and spread the run times across sites.
- Find the site that generates 404 and 500 errors in volume and fix it. In Elementor that is Regenerate Files & Data under Tools.
- After a week with no crashes, decide whether you need more RAM. If so, see scaling a server on Cloudways.
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).
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
Start a free trial server, no credit card. When you move to a paid plan, the code ASAEL takes 30% off your bill for the first three months.
The link fills in the code on the signup form. Just make sure it shows up.
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 works | When it fits |
|---|---|---|
| static | A fixed number of workers, set by pm.max_children | One busy site with plenty of RAM |
| dynamic | A variable number, with a minimum of spare workers that always run | One site, or a few sites with steady traffic |
| ondemand | A 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
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.
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.
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.
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.
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.
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.
Related guides
- Site down? How to check what happened
- 502, 503 and 504 errors on Cloudways
- Slow website and high CPU usage
- My Cloudways review
- All guides on this topic: Troubleshooting · Monitoring
Sources
- proc_pid_oom_score_adj(5) – Linux manual page
- PHP-FPM Configuration – PHP Manual
- InnoDB Buffer Pool – MariaDB Knowledge Base
- Rate limiting rules – Cloudflare Docs
- How to Monitor the RAM Usage of a Server – Cloudways KB
- How to Monitor System Processes Using htop Command – Cloudways KB
- Tickets #619034 (29 Jan 2025), #977464, #978826, #981625 (23–30 Sep 2026) in my Cloudways account
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