🐧
Linux

Managing Linux Processes with top, htop and ps

πŸ“… 19 October 2026 ✏️ 19 October 2026 ⏱ 6 min leestijd

Learn how to view and manage processes on your VPS or server with top, htop and ps. Practical commands to analyze slow servers and stop stuck processes.

If your server responds slowly or a service isn’t behaving properly, you want to quickly know which process is the culprit. The commands top, htop and ps give you immediate insight into what’s running on your Linux server: which processes are active, how much CPU and memory they use, and how to cleanly shut down a stuck process. In this article you’ll learn to apply all three tools practically.

Viewing processes with ps

ps (process status) gives a snapshot of currently running processes. It’s not a live display like top, but that’s exactly what makes it useful in scripts and quick checks.

The most commonly used combination is ps aux, which shows you all processes from all users, including CPU and memory usage, process ID (PID), and the command used to start the process. If you want to search for a specific process, combine this with grep, for example ps aux | grep mysql to see whether the database is running and with which PID.

An alternative syntax is ps -ef, which shows similar information but with a slightly different column layout, including the parent process (PPID). This is useful when you want to know which process started another process, for example with PHP-FPM workers under a master process.

πŸ’‘ Tip: Sort the output of ps by memory usage with ps aux --sort=-%mem | head to quickly see which processes use the most RAM.

Live monitoring with top

Where ps gives a snapshot, top shows a live, continuously updated overview. Simply start it with top in your terminal. At the top you see general server statistics such as load average, memory usage, and the number of active processes, and below that a list of processes sorted by CPU usage.

Within top you can work interactively with keyboard shortcuts: press M to sort by memory usage, P to sort by CPU usage, k to terminate a process via its PID, and q to exit top. The load average at the top indicates how heavily the server has been loaded over the past 1, 5 and 15 minutes; a high value relative to the number of CPU cores indicates overload.

Top is ideal as a first check when a server feels slow: you immediately see if there’s a single process claiming excessive resources.

Working more clearly with htop

htop is an improved, interactive version of top with colors, scrollable lists, and mouse support. It’s not always installed by default, but it’s easy to add with apt install htop on Debian/Ubuntu or yum install htop on CentOS/AlmaLinux.

In htop, you see at the top a bar per CPU core showing load, and a bar for memory and swap usage, so you can see at a glance whether the server is tight on resources. You can select processes with the arrow keys and terminate them directly with F9, after which you choose which signal to send. With F6 you sort by a column of your choice, and with F4 you filter by process or username.

A handy advantage of htop is the tree view (key t), which shows you which processes belong together, for example multiple PHP-FPM workers under the same master process. This makes it easier to understand why a service runs multiple processes simultaneously.

pstophtopsnapshotlive overviewinteractive

Terminating processes and adjusting priority

Sometimes you need to actively stop a process that isn’t responding or is using too many resources. You do this with the kill command followed by the PID, for example kill 1234. By default this sends the SIGTERM signal, which politely asks the process to shut down.

If a process doesn’t respond to SIGTERM, you can force it to stop with kill -9 1234 (SIGKILL). Use this sparingly, because the process gets no chance to cleanly close temporary files or write away changes, which can lead to data corruption in database processes.

If you want to stop by name instead of PID, use pkill name or killall name. You can also give processes lower or higher CPU priority with nice when starting them, or adjust it afterward with renice, handy if, for example, you want to give a background backup task lower priority than your web server.

1

Log in via SSH

Connect to your server via SSH to gain access to the terminal.

2

Start with top or htop

Get an immediate live overview of CPU and memory usage per process.

3

Identify the problem process

Sort by CPU or memory and note the PID of the process using the most resources.

4

Terminate or adjust priority

Use kill for a clean stop, kill -9 as a last resort, or renice to adjust priority.

If you manage a VPS or server with Tandata, you’ll also find most process statistics via Plesk, where you can view resource usage per website and email service without having to run commands yourself. If you’re unsure about a result or need help interpreting the output, our support is available 24/7 via WhatsApp, ticket, or email. You can find more explanation about server management in our knowledge base.

Frequently Asked Questions

What’s the difference between top and htop?

Top is present by default on almost every Linux system and provides a textual overview. Htop needs to be installed separately but offers colors, scrolling, mouse support, and easier filtering and sorting.

How do I safely stop a stuck process?

First try kill with the default SIGTERM signal, so the process can shut down cleanly. If it doesn’t respond, use kill -9 to force it to stop.

Why is a process using so much CPU?

This can be caused by a loop that gets stuck, too many simultaneous requests, a poorly optimized script, or a cron job that keeps running. Top and htop help you identify the specific process.

Can I also manage processes via Plesk?

Plesk shows resource usage per website and service, but for detailed process management at the operating system level you use ps, top, or htop via SSH.

Is it safe to stop other users’ processes?

Only root or a user with sufficient permissions can stop other users’ processes. Only do this if you’re certain what the process does, to avoid disrupting other services.

Conclusion

With ps, top, and htop you have everything you need to monitor and manage processes on your Linux server. Use ps for quick checks, top for live monitoring, and htop for a clear, interactive view. If a process gets stuck, stop it cleanly with kill or, if necessary, force it with kill -9.

View web hosting β†’

Was dit artikel nuttig?