USD ($)
$
United States Dollar
Euro Member Countries
India Rupee
د.إ
United Arab Emirates dirham
ر.س
Saudi Arabia Riyal

System Monitoring and Performance

Lesson 11/40 | Study Time: 20 Min

Effective system monitoring and performance analysis are essential for maintaining the health, stability, and efficiency of Linux systems. Monitoring key resources such as memory, CPU, and disk I/O enables administrators to identify bottlenecks, optimize usage, and troubleshoot problems proactively.

Linux provides a rich set of command-line utilities like free, vmstat, iostat, iotop, and mpstat that offer real-time and historical insights into various system metrics.

Memory Monitoring

Memory monitoring helps identify resource constraints and performance issues. The  following points describe commonly used commands for observing memory and swap activity.


free: Displays summary information about total, used, free, shared, buffer/cache memory, and swap space.

Example output snapshot:

text
total used free shared buff/cache available
Mem: 8040200 3100000 1500000 500000 3440200 4000000
Swap: 2097148 0 2097148


Use case: Spotting memory shortages, swap usage, and cache/buffer consumption.

Command:

bash
free -h


-h: human-readable units.

vmstat: Provides snapshots of system-wide memory and CPU usage over time, including paging and interrupts.

Example:

bash
vmstat 1 5


Outputs five samples at 1-second intervals; highlights free memory, swap activity, and CPU wait time.

Disk I/O Analysis

To diagnose storage performance problems, it is important to understand disk I/O monitoring tools and metrics. The points below explains how disk activity is measured.

iostat: Reports statistics on device utilization and I/O throughput, key to assessing disk performance.

Usage:

bash
iostat -dx 1 5


Important columns:


1. %util: Disk utilization (near 100% indicates saturation)

2. await: Average wait time for I/O requests

3. iotop: Interactive real-time display showing which processes consume the most disk I/O.


Command:

bash
sudo iotop

CPU Performance Monitoring

Linux provides multiple tools to track CPU usage in real time and over intervals. The list below highlights commonly used commands and performance metrics.


mpstat: Displays CPU usage statistics, including breakdowns per CPU core.

Example:

bash
mpstat -P ALL 1 5


-P ALL shows all CPUs, sampling 5 times with 1-second intervals.


Metrics:


%user: Time spent in user processes

%system: Kernel time

%iowait: Waiting for I/O

%idle: Idle CPU percentage

top / htop: Dynamic, interactive tools showing CPU, memory usage, process activity, and more.


top is standard; htop offers colored and customizable display.


Sales Campaign

Sales Campaign

We have a sales campaign on our promoted courses and products. You can purchase 1 products at a discounted price up to 15% discount.