Think of checking your Linux server like visiting a doctor for a routine check-up. The doctor checks your pulse, measures your blood pressure, and listens to your breathing. When a server feels sluggish, relying only on basic task managers like htop is like only checking body temperature. We need specialized tools to diagnose the heart of the problem.
Understanding Server Vital Signs
A computer server slows down for three primary reasons: high processor load (CPU), running out of memory (RAM), or slow disk storage (Disk I/O). Here is how you can inspect each vital sign clearly using standard command-line tools.
1. Listening to the Rhythm with vmstat
The vmstat command gives an instant overview of memory, processor activity, and system delays without cluttering your screen.
# Run vmstat once every 2 seconds, for a total of 5 checks
vmstat 2 5
# Look at the 'r' column (waiting tasks) and 'b' column (blocked tasks).
# If 'b' is consistently greater than 0, your storage disk is struggling to keep up.2. Checking Network Doors with ss
Think of your server as a house with many doors (called ports). Web visitors enter through door 80 or 443. The ss tool shows you exactly who is knocking and which doors are open.
# List all listening ports (doors waiting for connections)
# -t (TCP), -u (UDP), -l (Listening), -p (Show program name), -n (Numeric port)
sudo ss -tulpnQuick Summary for Beginners
- CPU & RAM: Check overall load and memory pressure first using
vmstat. - Disk I/O: If the processor is idle but things are slow, the disk is usually the bottleneck.
- Ports: Use
ss -tulpnto verify your web server (Nginx or Apache) is running and ready.