| Resource | In the kitchen | When it runs out |
|---|---|---|
| CPU | The cooks | Orders wait in line. The site gets slow or times out. |
| RAM (memory) | The counter space where cooks work | No room to work. Things get pushed to the floor (swap, very slow), or the kitchen throws a dish away (the kernel kills a process). |
| Disk | The pantry | Nothing new can be stored: uploads fail, the database stops, logs can't be written. |
| Command | Shows | Bad sign |
|---|---|---|
uptime | Load average (1, 5, 15 minutes) | Load higher than the number of CPUs for a long time. A KVM 1 has 1 CPU, so a load of 3 means 3 jobs for every cook. |
top | Live list of processes. Press P to sort by CPU, M by memory, c to see the full command (apps often just show as python3, node, java or php-fpm). | One process near 100% CPU, or using most of the RAM. |
free -h | Memory | The available column near zero. (A small "free" number is normal: Linux uses spare RAM as cache.) |
df -h | Disk space per partition | Use% above 90%. |
df -i | Inodes (how many files can exist) | IUse% at 100% even with free space. Usually millions of tiny files (sessions, cache). |
du -xh --max-depth=1 / | sort -h | Which folders are big | One folder far bigger than expected. |
journalctl -k | grep -iE "oom-kill|killed process" | Processes killed for lack of memory, and which service they belonged to | Any line at all. |
vmstat 1 10 | CPU details every second: wa (waiting for disk) and st (steal) | wa high for a long time; st above 10% consistently. |
Also useful: systemctl status <PID> shows which service a process belongs to, and lsof +L1 lists deleted files that are still open. Nicer tools like htop, ncdu and iotop may not be installed; everything above works on a fresh VPS.
php-fpm is at 100% because of a stuck import" is a cause./var/lib.Each case runs on the lab VPS srv2196542. The instructor starts it from the lab control page, you open the VPS Browser terminal in hPanel and diagnose it like a customer would. Section 7 explains how to run the lab.
What's going on: a worker program is stuck in a loop. It runs as a service that restarts it automatically, so killing it only works for a few seconds.
How to check:
top, then press P: image-resizer at ~100%.kill <PID>. Run top again: it's back with a new PID.systemctl status <PID> → image-resizer.service.Fix: systemctl stop image-resizer, then systemctl disable image-resizer so it doesn't start after a reboot. On a real server, the customer or developer then fixes the program itself. If it was started by cron, check crontab -l.
Real-world variants: a stuck WordPress cron or import, a bot flood on php-fpm, or a crypto miner after a hack. The last one is a security case: the customer must investigate and secure the VPS.
What's going on: one app is holding most of the memory.
How to check:
free -h: look at available, not "free".top, then press M: a python3 process uses about 70% of the memory. Press c: the full command is /opt/lab/bin/report-builder.systemctl status <PID> → report-builder.service.Fix: restart or stop the app (systemctl restart report-builder). On real servers the usual suspects are MySQL/MariaDB, too many PHP-FPM workers, Node.js apps and Java. Tuning them, or a bigger plan, is the long-term fix.
free -h shows plenty available, Linux is just using spare memory as cache. That's healthy, and it's given back when an app needs it.What's going on: a process keeps using more and more memory (a memory leak). When RAM runs out, the Linux kernel kills the biggest process to save the server: the OOM killer (out of memory). The service restarts it, and the cycle repeats.
How to check: journalctl -k | grep -iE "oom-kill|killed process". You'll see Out of memory: Killed process 1234 (python3), and on the oom-kill line, task_memcg=/system.slice/log-parser.service: that's the service. In top (M) you can watch its memory grow again after each restart.
Fix: stop the leaking service (systemctl disable --now log-parser) and have the developer fix the leak. Adding swap or upgrading only buys time.
On real servers the victim is often mysqld: it's usually the biggest process, so it gets killed even when another app caused the shortage.
What's going on: a debug log grew huge, and old backups were never removed.
How to check:
df -h: / at ~97%.du -xh --max-depth=1 / | sort -h, then repeat inside the biggest folder (for example du -xh --max-depth=1 /var | sort -h)./var/log/shop-app/debug.log (very big) and /root/backups/ with four old backups.Fix:
truncate -s 0 /var/log/shop-app/debug.log. Then turn off debug mode in the app, or set up log rotation.Other usual suspects: journalctl --disk-usage (system logs; clean with journalctl --vacuum-size=200M), Docker images and volumes (docker system df), and mail queues.
What's going on: a file was deleted while a program still had it open. Linux keeps the space reserved until that program closes the file. du can't see it (no name anymore), but df still counts it.
How to check: compare df -h with du -xh --max-depth=1 / | sort -h: they don't match. Then lsof +L1 lists deleted files still held open: a python3 process holds /var/log/log-shipper/buffer.log (deleted) of about 20 GB. systemctl status <PID> shows it's log-shipper.service.
Fix: restart the program that holds it: systemctl restart log-shipper. In the lab, run systemctl disable --now log-shipper to end the scenario. Run df -h again: the space is back.
Look at the CPU line at the top of top (or the vmstat 1 10 columns):
wa (I/O wait) high: the CPU is waiting for the disk. Usually a heavy backup, a big database query, or lots of swap. iotop, if installed, shows who is reading/writing.st (steal) high: the physical server is busy with other VPSs, so ours gets less CPU time. A little steal is normal.top and vmstat 1 10 at a time when the problem happens. Text pasted in the chat or CSV files aren't accepted as evidence.We can't open the VPS, so ask for these as screenshots:
uptime and top (sorted with P)free -h, top (sorted with M) and journalctl -k | grep -iE "oom-kill|killed process"df -h, df -i and du -xh --max-depth=1 / | sort -hvmstat 1 10```), since they break the chat.
/root.1. "I deleted a 15 GB log yesterday and df still shows the disk full."
Case 5. A program still holds the deleted file. lsof +L1, then restart that program.
2. "MySQL crashes at random times. The MySQL log just says it was restarted."
Case 3. Check journalctl -k | grep -iE "oom-kill|killed process" for the OOM killer, then find what's using the memory.
3. "free -h shows only 200 MB free, but available says 3.1 GB. Should I upgrade?"
Case 2's warning: no. Available is what matters; the rest is cache.
4. "There's a process called kdevtmpfsi using 400% CPU. I didn't install it."
Case 1, security variant: an unknown process at high CPU is a likely crypto miner. The customer must investigate and secure the VPS (the AI Agent can help).
5. "top shows my apps at 5% CPU, but the st value is 35% all day."
Case 6, CPU steal. Ask for screenshots of top and vmstat 1 10; above 10% consistently, investigate and consider a node transfer request.
lab start cpu (names: cpu, memory, oom, disk, disk-hidden).lab stop all.Run one scenario at a time: the lab VPS is a KVM 1 (1 CPU, 4 GB RAM, 50 GB disk), the same size many customers have. All scenarios are harmless simulations and stop cleanly.
Built for Hostinger Customer Success. Commands are standard Linux tools; every lab scenario runs on a real Hostinger VPS.