Latency on a memcached-plus-app box spikes randomly; `vmstat 1` shows non-zero `si` and `so` every second.
IntermediateTroubleshootingDisk, memory and CPU
Answer
Likely causes → The box is swapping: the working set no longer fits in RAM, so the kernel constantly pages memory in and out to disk. Each page fault on a request path costs milliseconds.
Diagnose →
vmstat 1 5 # si/so > 0 continuously = thrashing
free -m
for f in /proc/*/status; do awk '/^Name|^VmSwap/{printf $2" "}END{print ""}' $f; done 2>/dev/null | sort -k2 -nr | head
Fix → Reduce memory use (lower cache size, fewer workers) or move to a larger instance. Restarting the swapped process brings its pages back into RAM, but it's temporary.
Prevent → Size memory with headroom, set vm.swappiness=10 (or no swap on latency-sensitive hosts, with proper memory limits), and alert on swap-in rate, not only swap used.
More on Disk, memory and CPU
The app fails to write with "No space left on device", but `df -h` shows the volume is only 40% used.Beginner`df -h` says `/` is 100% full, but `du -sh /*` only adds up to 30% of the disk.BeginnerA server shows load average 40 on 8 cores, but `top` shows CPU 60% idle and the app is crawling.BeginnerPods are being evicted with "The node was low on resource: ephemeral-storage. Container app was using 18Gi, which exceeds its request of 0."IntermediateCI build agents running Docker fail with "no space left on device" while pulling images; `/var/lib/docker` is 95% full.IntermediatePostgres on a VM died overnight; `dmesg` shows "Out of memory: Killed process 2314 (postgres) total-vm:..., anon-rss:...".Intermediate