Overview
A Pod that feels slow, or that is consistently pegged at 100% CPU or out of memory, needs investigation before it affects your users. This article shows how to find the culprit.
Before you begin
- Root or sudo access.
- Note what changed recently — a new deployment, a traffic spike, or a new plugin.
Steps
- Get a quick overview with
toporhtop:
bash
top
Press M to sort by memory or P by CPU.
- Find the heaviest processes non-interactively:
bash
ps aux --sort=-%cpu | head
ps aux --sort=-%mem | head
- Check memory and swap:
bash
free -h
If swap is heavily used and available memory is near zero, you are memory-constrained.
- Check load average and CPU count:
bash
uptime
nproc
A load average higher than your CPU count means processes are queueing.
- Investigate the top process. For example, for a web service:
bash
systemctl status nginx
journalctl -u php8.2-fpm --since "1 hour ago"
For a database, look at slow queries rather than assuming the database is at fault.
- Look for runaways or malware. Unexpected processes consuming CPU (especially miners) are a red flag:
bash
sudo ps aux | grep -v '\['
sudo ss -tp
- Reduce pressure. Common fixes:
- Tune the number of PHP-FPM or worker processes.
- Enable caching (OPcache, Redis) for web applications.
- Reschedule heavy cron jobs to off-peak times.
- Add swap space as a safety net.
- Upgrade if it is genuine demand. If the workload has simply outgrown the Pod, resize to a larger CPU Pod from the ALYPOD Console.
Troubleshooting
- Problem: CPU is high but the top process keeps changing. Solution: Use
pidstat 1oratopto see which processes spike over time. - Problem: The OOM killer is terminating services. Solution: Check
dmesg | grep -i oom, increase memory, or fix the leak; add swap as a temporary buffer.
Related articles
- [Disk is full: how to free space]
- [My website shows a 500 error]
- [Protecting your server against malware]
