Stop Guessing: Actually Look At Your Server
A very common mistake when a server feels slow: people jump straight to “must be the host” or “WordPress is bloated” without actually looking at what the server is doing.
On Linux, the top command is usually the first tool you should reach for.
It shows you what’s running, how much CPU and RAM you’re using, and which processes are the hogs.
This guide is for anyone running a Linux-based server or VPS (for example, an Ubuntu 20.04 box over SSH).
We’ll walk through how to use top, what the important lines mean, and how to start troubleshooting performance issues on a live server.
Safety note:
topitself is read-only.
Just runningtopwon’t break anything.
But killing processes fromtopcan bring down your site or services, so we’ll be careful there.
Step 1: Connect To Your Linux Server Safely
You need a Linux-based machine to follow along.
This can be your local Linux box or, more commonly, a virtual private server (VPS) you connect to using SSH.
If you’re using a remote server, don’t log in as root directly if you can avoid it.
Use a regular user with sudo privileges instead.
That gives you a safer setup, and you’re less likely to nuke something by accident.
Typical SSH connection looks like this:
ssh youruser@your-server-ip
You’ll land in a shell.
From here, everything we do is just standard Linux terminal commands.
If you’re doing this on a production server (especially hosting client sites):
- Make sure you know which services are critical before killing anything
- If you have a staging server, practice there first
- Keep another SSH session open so you don’t lock yourself out while testing
Step 2: Run `top` To See What’s Really Happening
Once you’re at the shell prompt, just type:
top
You’ll see something like this (shortened example):
top - 15:14:40 up 46 min, 1 user, load average: 0.00, 0.01, 0.05
Tasks: 56 total, 1 running, 55 sleeping, 0 stopped, 0 zombie
Cpu(s): 0.0%us, 0.0%sy, 0.0%ni,100.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 1019600k total, 316576k used, 703024k free, 7652k buffers
Swap: 0k total, 0k used, 0k free, 258976k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
1 root 20 0 24188 2120 1300 S 0.0 0.2 0:00.56 init
2 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kthreadd
3 root 20 0 0 0 0 S 0.0 0.0 0:00.07 ksoftirqd/0
6 root RT 0 0 0 0 S 0.0 0.0 0:00.00 migration/0
top updates continuously until you quit.
To exit top, press:
q
A lot of people see this screen once, get overwhelmed by the numbers, and bail.
Let’s break it down and only focus on the parts that help you troubleshoot quickly.
Step 3: Read the Top Header Lines (The Health Bar)
Think of the first few lines of top as your server’s “health bar”.
They tell you if the machine is actually under load or just fine.
Line 1: Uptime and Load Average
Example:
top - 15:14:40 up 46 min, 1 user, load average: 0.00, 0.01, 0.05
Key pieces here:
up 46 min– how long the server has been running since last reboot1 user– how many logged-in usersload average: 0.00, 0.01, 0.05– system load over the last 1, 5, and 15 minutes
The load average tells you how busy the CPU has been.
The example values are basically idle.
If these numbers are high, it means processes are waiting for CPU time.
Line 2: Tasks (Processes)
Tasks: 56 total, 1 running, 55 sleeping, 0 stopped, 0 zombie
total– how many processes existrunning– actually using CPU right nowsleeping– idle, waiting for somethingzombie– dead processes that haven’t been cleaned up yet
Most processes will be sleeping.
A few running is normal.
If you see zombies, it’s usually a sign some parent process isn’t handling its children properly, but a few here and there may not be a crisis.
Line 3: CPU Usage
Cpu(s): 0.0%us, 0.0%sy, 0.0%ni,100.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Important parts:
%us– CPU time spent on user processes (your apps)%sy– CPU time spent in the kernel (system tasks)%id– idle CPU time%wa– time spent waiting on I/O (like disk operations)
In the example, %id is 100.0% – the CPU is totally bored.
If your server feels slow but CPU is mostly idle, the problem is probably somewhere else (disk, network, app-level).
Lines 4–5: Memory and Swap
Mem: 1019600k total, 316576k used, 703024k free, 7652k buffers
Swap: 0k total, 0k used, 0k free, 258976k cached
These show how much physical memory (RAM) and swap you have, and how much is used/free.
On healthy servers, you’ll often see RAM usage that looks “high” because Linux uses free RAM for caching.
That’s normal.
The red flag is when swap is in heavy use and the system feels sluggish.
In this example, swap is 0k used, so there’s no swapping happening.
Step 4: Understand the Process List (Who’s Eating What)
Below the header, you get a table of running processes, like this:
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
1 root 20 0 24188 2120 1300 S 0.0 0.2 0:00.56 init
2 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kthreadd
Quick rundown of important columns:
PID– process ID (used if you need to kill or inspect it)USER– user who owns the process%CPU– how much CPU time the process is using%MEM– how much of RAM the process is usingTIME+– total CPU time the process has usedCOMMAND– the name of the program
Focus on %CPU and %MEM when troubleshooting.
High %CPU means that process is working your CPU hard.
High %MEM means it’s eating RAM.
If your server is slow and CPU is pegged, scroll or sort in top to find the heaviest processes.
Those will usually be your culprits.
Step 5: Basic `top` Navigation and Actions
You don’t have to stick with the default view.
top is interactive while it’s running.
Here are some handy keys (press them while top is open):
q– quittopShift + P– sort by CPU usage (usually default)Shift + M– sort by memory usage
To quickly see the biggest memory hogs:
- Run
top - Press
Shift + M - Watch the
%MEMcolumn
Safety note:
topalso lets you kill processes, but this can drop your website or services instantly.
Never kill something if you don’t know what it does.
If you do need to kill a process from top:
- Find its
PIDin the left-most column - Press
k - Type the PID and press Enter
- Accept the default signal or confirm if asked
Again: this is risky on a production server.
Killing the wrong process can stop your database, web server, SSH session, or other critical services.
Use it only when you’re sure.
Step 6: Quick Troubleshooting Scenarios With `top`
Let’s run through some common real-world checks you can do with just top.
Scenario A: “The Server Is Slow, Is It CPU?”
- SSH into the server
- Run:
bash
top
- Look at:
load averageon the first line%idin theCpu(s)line
If load average is high and %id (idle) is low, your CPU is busy.
Then look at the process list and sort by CPU with Shift + P.
The top entries by %CPU are your main suspects.
Scenario B: “Are We Running Out of RAM?”
- Run
top - Look at the
MemandSwaplines - Press
Shift + Mto sort by memory usage
If swap usage is high and the machine feels very laggy, you may be memory constrained.
The processes at the top of the %MEM list are the ones you might need to tune, restart, or move off the box.
Scenario C: “Something Spiked, But It’s Calm Now”
Sometimes you miss the spike and log in after the fact.
You won’t always catch the culprit in top live.
In that case, TIME+ is useful.
If one process has a very high TIME+, it’s been chewing on CPU over its lifetime.
Combine that with %CPU to figure out which services have been working hardest.
Step 7: Make This Part of Your Regular Checks
The habit that saves a lot of headache: check top first before blaming anything else.
Anytime you hear “the site is slow”, “the server is dying”, or “hosting is trash”, hop into top and see what’s going on.
Rough checklist:
- Log in as a non-root user with
sudoprivileges - Run
top - Check load average and CPU idle (
%id) - Check memory and swap usage
- Sort by CPU (
Shift + P) to see hot processes - Sort by memory (
Shift + M) if you suspect RAM issues
From there, you can decide the next moves:
restart services, tune configs, or plan resource upgrades.
Remember: top is read-only until you start sending signals to processes.
You can safely use it to observe anytime without breaking things.
If this worked for you, keep CrushEdge handy for the next fix.
No Comments