>_ IzzyLab

Hands-on task

This task is step 10 of the course “Processes and signals”

Who ate the CPU

medium~3 min

The server is barely moving. Three background processes run on it: resizer, resizer-queue and mailer. One of them has gone into an infinite loop and keeps the CPU at 100%. Find it by CPU usage and stop it — the other two must keep running.

What you'll practise:
  • ps --sort
  • top
  • pkill -x
  • signals
  • finding a process

Topic breakdown

Kill a process only once the culprit is proven: top (sorted by %CPU) and ps --sort=-%cpu show who's really eating the CPU, and the cumulative time column tells a long-running loop from a short spike. The second trap is signalling by name: by default pkill and pgrep treat the pattern as a regular expression matched against a substring of the name, so resizer also matches resizer-queue. The exact-name flag and a "dry run" with pgrep before pkill protect you from collateral damage.

What's checked

  1. the CPU hog is stopped
  2. resizer-queue is alive
  3. mailer is alive

What it looks like