πŸ“ˆ
Hosting

Server Monitoring with htop: Live CPU and RAM Analysis

28.09.2030
← All articles

htop is a real-time monitoring tool for Linux servers, a friendly alternative to the classic top command. Created by Hisham Muhammad in 2004. Unlike top, htop offers color, mouse support, interactive search, and process management via signals.

What htop shows

Top section β€” overall server status: each CPU core's load (colored graph), Memory (RAM) usage graph, Swap (swap memory) graph, Tasks (process count), Load Average (1/5/15 minutes), Uptime (how long the server has been running).

Bottom section β€” process list: PID (process ID), USER, PRI (priority), NI (nice), VIRT (virtual memory), RES (resident memory), SHR (shared memory), S (status: R running, S sleeping, Z zombie), CPU%, MEM%, TIME+, Command.

Interactive commands

F1 β€” Help. F2 β€” Setup. F3 β€” Search. F4 β€” Filter. F5 β€” Tree view (process tree). F6 β€” Sort by. F7/F8 β€” Nice (change priority). F9 β€” Kill (terminate process). F10 β€” Quit.

Useful shortcuts: t β€” tree view, M β€” sort by Memory, P β€” sort by CPU, T β€” sort by time, u β€” filter by user.

Common scenarios

Find a slow server: press P to sort by CPU. The heaviest CPU consumers appear at top β€” often MySQL, PHP-FPM, Apache, or nginx processes.

Find RAM exhaustion: press M to sort by Memory. Heaviest RAM users at top. Example: one PHP process using 500MB+ usually signals a memory leak.

Find zombies: F3 search and look for status Z. Zombie processes are terminated but the parent still holds a reference. They don't burn server resources notably, but cleaning them up is good hygiene.

Installation

Ubuntu/Debian: sudo apt install htop. CentOS/RHEL: sudo yum install htop. For automatic snapshots via cron: htop -d 5 -n 1 -b β€” refresh every 5 seconds, run once, batch mode.

Sayt.uz practice

Sayt.uz sysadmins use htop daily β€” to check each server's state and watch for anomalies. When clients report "my site is slow", htop lets us understand CPU, RAM, and MySQL state in a few minutes. VPS clients also have SSH access to htop. Tip: we recommend htop only to technical clients β€” others are better off with cPanel's graphical visualizations.

Related articles

πŸ’° Hosting Price Comparison: Uzbek and International Providers πŸ“‘ Server Monitoring Tools: Prometheus, Grafana, Datadog, and More 🌐 Edge Computing Hosting: Moving Compute Closer to Users 🏒 Colocation Server: Placing Your Own Hardware in a Data Center
🌐 Language
πŸ‡ΊπŸ‡Ώ O'zbek πŸ‡ΊπŸ‡Ώ ЎзбСк πŸ‡·πŸ‡Ί Русский πŸ‡¬πŸ‡§ English βœ“