Common Linux Commands for System Stress Testing and Performance Monitoring
This article introduces a collection of essential Linux command‑line tools for stress testing and monitoring system resources such as CPU, memory, disk, network, processes, load, temperature, and other aspects, helping administrators assess stability and performance.
Stress testing is a crucial method for evaluating system stability and performance, especially regarding network latency and concurrent access. Linux provides a rich set of native command‑line utilities that enable simple and reliable stress testing.
CPU related commands:
top : Real‑time display of overall system performance.
htop : Interactive process viewer offering detailed CPU and system metrics.
mpstat : Shows average utilization for each processor.
sar : Reports historical system activity data, including CPU usage, load, and I/O.
Memory related commands:
free : Displays memory usage.
vmstat : Provides statistics on memory, CPU, disk, and swap.
smem : Detailed memory usage, including per‑process and kernel consumption.
pmap : Shows memory mappings of a process.
Disk related commands:
df : Shows filesystem disk space usage.
df -h : Human‑readable disk usage.
du : Estimates disk space used by files and directories.
du -sh <directory_path> : Summarizes total size of a directory.
iostat : Reports statistics on disk I/O activity.
fuser : Lists processes using a specified file or filesystem.
fuser -v <file_path> : Verbose process listing for a file.
Network related commands:
netstat : Displays network connections, routing tables, and interface statistics.
netstat -a : Shows all sockets.
ss : Provides detailed socket statistics.
ss -s : Summary of socket statistics.
iftop : Real‑time bandwidth usage per network interface.
iftop -n : Numeric output without DNS resolution.
tcpdump : Captures and analyzes network packets.
tcpdump -i <interface> -n : Capture on a specific interface with numeric output.
Process related commands:
ps : Shows current active processes.
ps aux : Detailed process listing.
top : Real‑time display of CPU, memory, and I/O usage per process.
pgrep <process_name> : Finds process IDs by name.
pkill <process_name> : Terminates processes by name.
Load related commands:
uptime : Shows system average load and uptime.
w : Displays logged‑in users and system load.
Temperature related commands:
sensors : Shows hardware sensor temperatures and voltages.
hddtemp : Displays hard‑disk temperature.
hddtemp /dev/sda : Example command for a specific disk.
Other useful commands:
lsof : Lists open files and the processes using them.
strace : Traces system calls and signals of a process.
strace <command> : Example usage.
dmesg : Shows kernel ring buffer messages.
sar : Reports historical system activity (CPU, memory, disk, network, etc.).
Note that this list covers only a subset of common commands; actual output may vary across Linux distributions, and users should consult each command’s manual for additional options.
Test Development Learning Exchange
Test Development Learning Exchange
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.