top / htop
What is top / htop?
top / htop: Table of Processes / Interactive Process Viewer — Live view of CPU and memory usage by process. htop is the friendly version. top shows a live view of processes and their CPU and memory use, updated every few seconds. htop does the same with colours, scrolling, search and easy sorting, and is usually installed separately.
Frequently asked questions about top / htop
How is top / htop used in practice?
They answer the first question when a server is slow: which process is using the resources? A runaway queue worker, a stuck cron job or a memory leak usually shows up at the top of the list.
What should you keep in mind with top / htop?
The load average in the header tells you how busy the system has been over the last one, five and fifteen minutes; compare it with the number of CPU cores. Inside containers, top shows only the container's processes. For Kubernetes, kubectl top pods gives a similar overview per pod, using the metrics server.
At a glance
| Category | CLI commands |
|---|---|
| Explained by | Reinier de la Parra |
| Updated |