High RAM Usage and OOM Checklist for WordPress VPS
When a VPS runs out of memory, Linux may kill processes such as PHP-FPM, MySQL or Docker containers. This can create 502 errors, database connection errors, failed backups and unstable automation workflows.
Core principle
RAM exhaustion is often a capacity and process-control problem. You need to know which processes consume memory and whether the server has enough headroom for traffic spikes and background jobs.
Checklist
- Check available RAM.
- Check swap usage.
- Find top memory-consuming processes.
- Check if MySQL is using too much memory.
- Check PHP-FPM worker count and memory usage.
- Check Docker container memory usage.
- Review recent traffic, imports or backup jobs.
- Check system logs for OOM kill events.
- Add or tune swap if appropriate.
- Reduce memory pressure or upgrade VPS if needed.
Reusable lesson
When RAM is the bottleneck, restarts may temporarily help but do not solve the pattern. You need to reduce memory demand or increase available memory.
When to Use This Checklist
Use this checklist when a VPS shows memory pressure, random service crashes, 502 errors or OOM kill events.
Required Tools
SSH access, Linux terminal, PHP-FPM, MySQL, Docker if used, system logs, VPS monitoring
Before You Start
Do not assume every crash is a software bug. Check whether Linux killed a process because memory ran out.
Structured Checklist Steps
- Check free memory.
- Check swap.
- Find top memory processes.
- Check MySQL memory usage.
- Check PHP-FPM workers.
- Check Docker memory.
- Review heavy jobs.
- Look for OOM events.
- Tune swap if needed.
- Plan capacity fix.
Verification Steps
- Memory bottleneck is confirmed or ruled out.
- Top memory consumers are known.
- No recent OOM event remains unexplained.
- Services stay active after mitigation.
- Swap and RAM status are documented.
Rollback Plan
If memory tuning breaks services, restore the previous PHP-FPM, MySQL or Docker configuration and restart only the affected service.
Common Mistakes
- Ignoring OOM logs.
- Adding cache plugins that increase memory use.
- Running too many PHP workers on a small VPS.
- No swap on a low-RAM server.
- Running heavy Docker apps on a tiny VPS.
Related Commands
free -h
swapon --show
ps aux --sort=-%mem | head
dmesg -T | grep -i "killed process"
journalctl -k | grep -i oom
docker stats