
Sometimes, you may notice your server running slowly, but you can’t determine what’s wrong. Luckily, you can quickly diagnose and manage situations using htop and iotop Linux VPS.
This guide explains how to use these remote monitoring tools to check high CPU usage and disk activity. It also teaches you how to manage system resources for a stable server.
Tools like htop and iotop help you monitor CPU usage and disk activity in real time. The comparison table below highlights VPS hosting providers that deliver consistent performance under load, making monitoring results more meaningful. Explore our recommended VPS hosting options.
Linux VPS Hosting Providers With Stable CPU and Disk I O Performance
| Provider | User Rating | Recommended For | |
|---|---|---|---|
![]() | 4.8 | Scalability | Visit Kamatera |
![]() | 4.6 | Affordability | Visit Hostinger |
![]() | 4.7 | Developers | Visit IONOS |
Understanding Monitoring Tools for Linux VPS
Before using htop and iotop on Linux VPS hosting, it is crucial to understand them. Let’s quickly explain the importance of these tools.
Why htop is Essential for Real-Time Monitoring
htop is a fast and interactive tool for Linux systems. It serves as a higher alternative to the standard top command. htop offers color-coded visuals, vertical/horizontal scrolling, and mouse interaction.
In addition, htop allows you to monitor CPU and RAM usage in real-time. Plus, it gives you visibility for when there are many inbox join medium notifications. htop provides a “right now” view of system health without using complex configuration or setup files.
The Role of iotop in Tracking Disk Activity
iotop specifically identifies processes affecting disk I/O (Input/Output). It reveals hidden performance bottlenecks by displaying read/write rates per process.
iotop identifies heavy logging and backup operations that are causing system latency. Beyond this, iotop needs sudo privileges to access kernel-level disk counters.
Importance for the DevOps Engineer
These tools enable fast debugging. That is, SSH in, run htop/iotop, find the bottleneck, and resolve it.
Unlike parsing log files or waiting for historical data accumulation, iotop’s workflow saves time. DevOps engineers can always detect issues in their early stages.
How to Install htop and iotop on Your Linux System
You can install htop and iotop on most Linux distributions.
1. Installation on Debian and Ubuntu

The apt package manager makes command-line execution simpler.
Run sudo apt-get update && sudo apt-get install htop for htop installation. Run sudo apt-get install iotop for iotop.
Next, type htop or sudo iotop in your terminal to launch. Note that iotop requires root access to display valuable data.
2. Installation on CentOS, AlmaLinux, and Rocky Linux
Use yum or dnf for package management on these distributions. Depending on your version, run sudo yum install htop or sudo dnf install htop for htop.
For iotop, run yum install iotop or dnf install iotop. Enable the EPEL repository with sudo yum install epel-release to find packages.
3. Installation on Fedora and Arch Linux
Fedora users should run sudo dnf install htop and sudo dnf install iotop. Arch Linux users utilize pacman: sudo pacman -S htop and sudo pacman -S iotop.
Note that iotop needs direct kernel access to run in toolbox containers.
4. Permissions and Sudo Requirements
htop needs root access to stop other processes run by other users. iotop requires superuser (sudo) privileges to access kernel-level disk counters. Always verify that you are using the correct instance to run these interactive commands.
Navigating the htop Interface for Maximum Visibility
Let’s show you how to use the htop tool for system monitoring.
Understanding CPU Usage and Color Codes

You will see bars for CPU cores in the top section. A multi-core system will have vertical stacks of horizontal bars.
Different colors mean:
- Green: User processes
- Red: System processes
- Blue: Nice priority tasks
- Yellow/Orange: IOwait
These colors are a quick glance at resource distribution.
Red bars mean heavy interface or high kernel/system usage. Short spikes between 90% and 100% are normal for intensive operations. Consistent high usage indicates saturation.
Monitoring Memory Usage and Swap
Bars show Total versus Used Memory (RAM) and Swap usage. The memory bar shows the amount of RAM used. Continuous growth with high Swap-In/Out rates means RAM shortage. High swap usage often causes sluggishness.
Interpreting Load Averages
Metrics show the 1-, 5-, and 15-minute load averages. These are the average number of processes waiting for CPU time.
You must investigate a 5-minute load average above your vCPU count times 1.0. A high load and low CPU usage are likely due to disk activity (IOwait). Processes are not consuming CPU cycles; they are waiting for disk operations.
The Process List and Sorting Columns
The main view shows:
- PID (process ID)
- USER
- CPU%
- MEM%
- TIME
- COMMAND
This comprehensive guide to running processes explains process management.
You can scroll the interface vertically and horizontally to see full commands. The default display affects long commands.
You can also resize columns with the mouse or arrow keys. Use Setup (F2) to add columns like RCHAR (bytes read) and WCHAR (bytes written).

Using htop Interactive Commands to Manage Processes
Use the following commands to manage processes on htop.
1. Sorting Processes (F6)
Arrange the process list by specific metrics with F6. A menu shows sort options. When diagnosing high CPU usage:
- CPU% identifies processes that use the most processor power.
- MEM% identifies memory hogs or leaks.
- TIME shows processes stuck in an endless loop.
2. Searching and Filtering (F3/F4)
F3 (Search) identifies processes matching a specific name. F4 (Filter) hides all processes that don’t match the filter.
3. Killing or Renicing Processes (F9/F7/F8)
F9 (Kill) signals to stop a selected process. Select SIGTERM (graceful) or SIGKILL (forceful).
F7/F8 (Nice) increases or decreases process priority. Higher priority indicates lower nice values.
Set a heavy backup job as low priority processes to contain more critical tasks.
4. Using Tree View for Parent-Child Relationships (F5)
Press F5 to toggle Tree View like the pstree program. This shows which process created another. This helps to trace the leading cause of a process group issue.
Diagnosing High CPU Usage and Memory Issues with htop Examples
We’ve provided examples to help you diagnose with htop.
Scenario 1: Identifying CPU Bottlenecks (SQL Queries)

A sluggish website and htop displays one core at 100%. Sort by CPU%, and mysqld or postgres are the causes.
A single heavy SQL query or a missing database index is often the root cause. A poorly optimized query can take up an entire CPU core.
Check database logs or query cache settings. Use EXPLAIN on suspect queries to find performance bottlenecks.
Scenario 2: Detecting Memory Leaks in PHP-FPM
The swap bar rises, and your system is slow, but the CPU is normal. Use MEM% to sort and check large Resident (RES) footprints for php-fpm.
Possible causes include too many workers, memory leaks in the code, or an inadequate OPcache. Each PHP worker uses RAM, and leaks compound over time.
Modify pm.max_children in your PHP-FPM setup. You can also restart the service to free RAM.
Scenario 3: Investigating High Load Average
You have a 5.0 load average on a 2 vCPU server. Check the “IOwait” color in CPU bars. It often looks gray or red.
Switch to iotop if CPU usage is low, but load is high. The CPU is idle. This happens when importing a database or writing log files heavily.
Analyzing Disk I/O with iotop on Linux VPS
Now, let’s review disk I/O with iotop.
Understanding iotop Columns: Read, Write, and IO%
DISK READ/WRITE displays ongoing network throughput per process in KB/s or MB/s. This shows which program is using the disk.
IO% means the percentage of time spent waiting for disk I/O. The whole VPS often freezes with high IO%.
SWAPIN% shows time spent reading from swap. Your system is thrashing between RAM and disk when the number is high.

Using Command Line Flags for Better Insights (-o, -P, -a)
- -o (Only) declutters the output by showing only processes doing I/O.
- -P (Processes) shows only processes to prevent multi-threaded programs from creating several entries.
- -a (Accumulated) shows total data read/written since iotop began.
The command sudo iotop -oPa ensures maximum clarity by combining the three flags.
Accumulating Stats to Find Long-Term Resource Hogs
Accumulate data by running sudo iotop -a. Let it run for an hour to catch the periodically bursting script. Intermittent disk spikes often result from cron jobs or scheduled tasks. This method identifies processes you can’t see with quick checks.
Troubleshooting Disk Activity with iotop Examples
Let’s show you examples to fix disk activity using iotop.
Scenario 1: Database Imports Stalling the System
The system is running a large SQL import. iotop displays mysqld with high WRITE speed and 99% IO%.
The web server times out while waiting for the database. Monopolizing imports prevents other processes from accessing the disk.
Use ionice to throttle the import or upgrade to faster storage, such as NVMe. Also, schedule imports during off-peak hours.
Scenario 2: Heavy Log Writes and Rotation
Disk space fills up quickly, and system performance reduces. iotop displays rsyslogd or a web server app at the top. This happens due to leaving debug mode on or log rotation compressing huge files.
In your application configuration, disable verbose logging. Also, reduce local disk usage by reducing remote log aggregation.
Scenario 3: Backup Processes (Tar/Rsync)
Your server slows down at 2 AM. iotop shows tar or rsync dominating the READ/WRITE columns. The backup job competes with production workloads because it runs with the default priority.
Lower the disk priority of the backup script with ionice. Run it in the idle class by putting ionice -c 3 before your backup command.
Comparison: htop vs. iotop for System Monitoring
The table below compares using htop and iotop Linux VPS:
| Aspect | htop | iotop |
| Primary Focus | CPU, RAM, Swap, Load Average | Disk I/O (Read/Write/IO%) |
| Interactivity | High (Kill, Renice, Sort, Tree) | Low (Fixed sort, no kill) |
| Install Example | apt install htop (Debian) | apt install iotop |
| Key Metrics | CPU%, MEM%, Uptime, Tasks | Disk Read/Write speeds, IO Wait% |
| Flags/Setup | F2 Setup, F6 Sort | -oPa (Active/Accumulated) |
| Best For | General slowness, stuck processes | Database lag, backup issues, slow disk |
Optimizing Your Digital Presence on a High-Performance VPS
The foundation of your online journey starts with creating a solid website or store. User-friendly website builders like Hostinger and IONOS are top-tier choices to help you. They often have the best web hosting plans to scale your VPS setup.
You can also use Fiverr or Upwork to hire a freelance DevOps expert for custom development work. Combine this with reliable web hosting providers to get excellent performance.
In addition, you should migrate to a VPS or dedicated server when you keep hitting resource limits. Know whether a managed or unmanaged VPS suits your skill level and needs.
Finally, you can develop the right strategy to improve performance by understanding the uses of a VPS.
Conclusion
Change your management game by using htop and iotop Linux VPS. These powerful tools provide a real-time view of system performance. You should be able to maintain long-term health by monitoring your Linux server.
Next Steps: What Now?
Follow these steps to use htop and iotop on Linux VPS:
- Install htop and iotop on your Linux system.
- Launch and setup permissions for both tools.
- Monitor CPU and memory usage on htop.
- Analyze disk activity with iotop.
- Troubleshoot bottlenecks with the proper commands.





