Monitoring Server Resources with htop and top
Practical guide to checking live VPS resource usage with top and htop: CPU, memory, load average, swap, processes and performance troubleshooting.
Introduction
When a VPS or server becomes slow, the first question is usually: what is using the resources right now? Tools like top and htop help answer that question by showing CPU usage, memory usage, load average, running processes and high-resource tasks in real time.
These tools are useful during live troubleshooting, but they are not a full monitoring system by themselves. They show what is happening now. For long-term reliability, you should also use uptime monitoring, logs, alerts and historical resource metrics.
Quick answer
Use top or htop to check live CPU usage, memory usage, swap, load average and the processes consuming the most resources. If the server is slow, look for high CPU, high memory, swap usage, high load average, stuck processes, database overload, PHP workers, web server spikes or backup/cron jobs running at the wrong time.
top and htop
top and htop are command-line tools for viewing live server resource usage.
top
- A standard Linux tool available on most servers.
- Shows CPU, memory, load average and process usage.
htop
- An interactive, more readable process viewer.
- Easier to navigate, sort and understand, but may need to be installed.
Both tools help you see:
- current CPU usage
- memory usage
- swap usage
- load average
- running processes
- process IDs
- users running processes
- commands consuming resources
- stuck or long-running tasks
top and htop are best for live diagnosis. They do not replace historical monitoring or alerting.
What to check first
When opening top or htop, start with the main server health indicators.
Check:
- load average
- CPU usage
- memory usage
- swap usage
- top processes
- process user
- command name
- process age
- disk activity if available
- number of running tasks
- zombie processes
Do not focus only on one number. A server can be slow because of CPU, RAM, disk I/O, database load, PHP workers, cron jobs or network issues.
Load average
Load average shows how many processes are running or waiting for CPU or I/O. It is usually shown for 1, 5 and 15 minutes.
load average: 2.50, 1.80, 1.20
Meaning:
- 1-minute average: recent load
- 5-minute average: medium trend
- 15-minute average: longer trend
A load average near or below the number of CPU cores is usually acceptable. A load average much higher than CPU cores may indicate overload, but disk I/O wait can also increase load.
Example on a 2-core VPS:
- load 1.0 may be fine
- load 2.0 may be near full use
- load 6.0 may indicate overload or waiting tasks
CPU usage
CPU usage shows how busy the processor is.
Common signs:
- one process using very high CPU
- many PHP or web server workers active
- database process consuming CPU
- backup/compression process running
- malware or unknown process using CPU
- high system CPU usage
- high I/O wait
Important values:
- user CPU: application workload
- system CPU: kernel/system work
- idle: unused CPU
- wait/I/O wait: waiting for disk operations
High CPU is not always bad if it is temporary. Persistent high CPU during normal traffic means the server may need optimization, caching or more resources.
Memory and swap
Memory usage shows how much RAM is being used. Linux uses free RAM for cache, so low “free” memory is not always a problem.
Watch for:
- very low available memory
- high swap usage
- processes using too much RAM
- database memory pressure
- PHP workers consuming memory
- repeated out-of-memory errors
- server slowing when swap increases
Swap is disk-based memory. Some swap usage can be normal, but heavy swap usage often makes a VPS slow because disk is much slower than RAM.
Processes and users
Each running task appears as a process. top and htop show the process ID, user, CPU usage, memory usage and command.
Useful columns:
- PID: process ID
- USER: account running the process
- CPU%: processor usage
- MEM%: memory usage
- TIME+: total CPU time
- COMMAND: what process is running
The USER column is useful on hosting servers because it can show which account or service is consuming resources.
Using top
top is usually installed by default.
Open top:
top
Sort by memory:
Press M
Sort by CPU:
Press P
Show full command:
Press c
Quit:
Press q
Watch a specific user:
top -u username
top is less visual than htop, but it is reliable and available on almost every Linux server.
Using htop
htop is easier to read and navigate than top, but it may need installation.
Install htop on Ubuntu/Debian:
sudo apt update
sudo apt install htop -y
Install htop on AlmaLinux/Rocky:
sudo dnf install htop -y
Open htop:
htop
Sort by CPU:
Press F6 and select CPU%
Sort by memory:
Press F6 and select MEM%
Search process:
Press F3
Filter:
Press F4
Tree view:
Press F5
Kill process:
Press F9
Quit:
Press F10
Do not kill processes unless you understand what they do. Killing database, web server or system processes can cause downtime or data issues.
Why this matters
Server resource monitoring matters because slow websites are often caused by resource pressure. A website may return 200 OK but still feel slow if PHP workers, database queries, backups, cron jobs or other processes overload the VPS.
Live tools like top and htop help you identify the current bottleneck before guessing or restarting services blindly.
How to check live server resources
Use htop or top during a slow website incident, then compare findings with logs and website checks.
- Load average — Compare load with CPU core count.
- CPU usage — Find whether CPU is saturated.
- Memory available — Check whether RAM is low.
- Swap usage — Look for heavy swap activity.
- Top processes — Sort by CPU and memory.
- Process user — Identify which account or service owns the load.
- Command — Check whether load comes from web server, PHP, database, backup, cron or unknown process.
- Logs — Compare process activity with web server, PHP and database logs.
Check website status during server issues
Use Website Status Checker to confirm HTTP response, redirects and availability while investigating CPU, memory or process load.
Common problems
High load average
MediumMany processes are running or waiting for CPU/disk resources.
Next step: Compare load with CPU cores and check top CPU/I/O processes.
CPU at 100%
HighThe server may be saturated by one or many processes.
Next step: Sort by CPU and identify the process, user and command.
Heavy swap usage
HighThe server is using disk as memory, which can make everything slow.
Next step: Check memory-heavy processes and consider optimization or more RAM.
Database process consuming resources
MediumMySQL/MariaDB may be handling slow queries or heavy traffic.
Next step: Check database logs, slow queries and application behavior.
Too many PHP workers
MediumA site or account may be generating many concurrent PHP requests.
Next step: Check web logs, PHP-FPM pools, plugins and traffic spikes.
Backup or cron job overload
MediumScheduled jobs may run during active traffic hours.
Next step: Move heavy jobs to low-traffic windows and limit resource usage.
Unknown process using resources
HighUnexpected processes may indicate misconfiguration or compromise.
Next step: Investigate command path, user, logs and recent changes.
Zombie processes
LowDefunct processes remain after parent process issues.
Next step: Identify parent process and restart related service if needed.
Disk full but CPU looks normal
HighServer may fail even without CPU overload.
Next step: Check disk usage with df -h and clean or expand storage.
Restarting services blindly
MediumRestarting may hide the cause temporarily without fixing it.
Next step: Capture process and log evidence before restarting when possible.
How to troubleshoot server load with top and htop
-
Step 1: Open htop or top
Check live CPU, memory, swap and process usage.
-
Step 2: Check load average
Compare 1, 5 and 15 minute load with CPU core count.
-
Step 3: Sort by CPU
Identify processes using the most processor time.
-
Step 4: Sort by memory
Find processes consuming large amounts of RAM.
-
Step 5: Identify the user
Check whether load belongs to a website account, database, system service or unknown user.
-
Step 6: Check command
Read the process command to understand what is running.
-
Step 7: Compare with logs
Check web server, PHP, database and system logs at the same time.
-
Step 8: Take safe action
Optimize, limit, reschedule or restart only after identifying the likely cause.
-
Step 9: Add monitoring
Set alerts and historical metrics so the issue can be tracked over time.
Common processes you may see
The process list depends on your server stack.
Common processes:
- apache2 or httpd: Apache web server
- nginx: Nginx web server
- php-fpm: PHP worker process
- mysqld or mariadbd: MySQL/MariaDB database
- named: DNS service
- exim or postfix: mail server
- dovecot: IMAP/POP mail service
- redis-server: Redis cache
- cron: scheduled tasks
- rsync: file sync or backup
- tar/gzip: compression or backup
- certbot: SSL certificate tasks
If you see an unfamiliar process using high CPU or memory, investigate before assuming it is safe.
What top and htop cannot show
top and htop show live process usage, but they do not explain everything.
They do not fully show:
- historical trends
- exact slow SQL queries
- full request URLs
- external network failures
- application-level errors
- CDN issues
- DNS issues
- user experience in browser
- long-term uptime
- exact root cause of every spike
Use top and htop together with logs, monitoring, website status checks and application profiling.
Monitoring strategy
For production servers, combine live tools with continuous monitoring.
Monitor:
- uptime
- website HTTP status
- response time
- CPU usage
- memory usage
- swap usage
- disk space
- disk I/O if available
- database health
- web server health
- SSL expiry
- backup success
- security updates
htop helps during an incident. Monitoring helps you know when the incident started, how long it lasted and whether it repeats.
Server resource examples
Example 1: High CPU
Symptom:
Website is slow.
htop:
php-fpm processes using 95% CPU.
Likely cause:
Heavy PHP requests, plugin issue, traffic spike or slow application code.
Next step:
Check access logs, PHP logs and recent website changes.
Example 2: Heavy swap
Symptom:
Server responds slowly.
free -m:
Swap usage is high.
htop:
Database and PHP workers consume most RAM.
Likely cause:
Not enough memory or too many concurrent workers.
Next step:
Tune services, reduce concurrency or upgrade RAM.
Example 3: Backup overload
Symptom:
Site slows every night.
htop:
tar and gzip processes use high CPU.
Likely cause:
Backup job running during active traffic.
Next step:
Move backup to low-traffic window and limit resource usage.
Examples are illustrative. Always confirm with logs, metrics and service status before making changes.
Frequently asked questions
What is top?
top is a standard Linux tool that shows live CPU, memory, load and process usage.
What is htop?
htop is an interactive process viewer that is easier to read and sort than top.
Is high CPU always bad?
No. Short spikes can be normal. Persistent high CPU during normal traffic needs investigation.
What does load average mean?
It shows how many processes are running or waiting for CPU or I/O over 1, 5 and 15 minutes.
Is swap usage bad?
Small swap usage can be normal. Heavy swap usage often causes slow performance.
Can I kill high-resource processes?
Only if you understand what they are. Killing critical services can cause downtime or data issues.
Do top and htop replace monitoring?
No. They show live usage. You still need historical monitoring and alerts.
Related tools
Use these free tools to verify your configuration after applying changes.
Related guides
Browse all Hosting & VPS guides →Need help applying this fix?
Send us your domain, report link or issue details. CheckDomainHealth will review the request and route it to the right technical team if hands-on support is needed.
Was this guide helpful?
Your feedback helps us improve our guides for everyone.
Thanks for your feedback!