bk99.de entertain the web since 1997

htop explained

Summary

Pēteris Ņikiforovs explains every htop display and links it with Linux processes, the scheduler, memory management and procfs. /proc/loadavg provides load values, process counts and the most recently assigned PID. PID 1 traditionally belongs to the init process started at boot.

Ideas

  • Load average counts running and waiting tasks, not percentage CPU utilisation.
  • The three load values smooth one, five and fifteen minutes respectively.
  • Process states distinguish computation, interruptible waiting, I/O waiting and zombies.
  • Virtual memory describes address space, while RSS measures memory that is actually resident.
  • strace shows which procfs files a diagnostic tool really reads.
  • A process tree explains relationships better than a flat list sorted by consumption.

Insights

  • Measurements only become diagnostically useful through time windows, states and system architecture.
  • Linux tools often condense directly readable kernel information into human-friendly views.
  • High load proves neither full CPU utilisation nor a single culprit.

Facts

  • Multi-core systems can report total idle time greater than their actual uptime.
  • Zombies are terminated processes whose parents have not yet collected their exit status.

Recommendations

  • Always compare load values with the number of CPUs, process states and I/O wait.
  • Use the tree view and the command line together to identify culprits unambiguously.
  • Check conspicuous values directly in procfs or with strace.

References

Read the original article

Search the Web Archive