A comprehensive command-line tool for Linux system performance analysis based on Brendan Gregg's performance checklist.
This script automates the collection and analysis of critical system performance metrics, helping you quickly identify bottlenecks and performance issues on Linux systems. It provides color-coded output with intuitive analysis of key performance indicators.
The script performs nine key performance checks:
- Load Average Analysis: Examines if system load is increasing or decreasing
- Kernel Error Detection: Identifies recent kernel errors including OOM events
- System-wide Statistics: Monitors run queue length, swapping, and overall CPU usage
- CPU Balance Check: Identifies potential thread scaling issues
- Process CPU Usage: Lists top CPU-consuming processes
- Disk I/O Analysis: Reports IOPS, throughput, wait time, and utilization
- Memory Usage: Examines memory consumption including file system cache
- Network I/O: Monitors network device traffic
- TCP Statistics: Tracks connection rates and retransmits
- Linux operating system
sysstatpackage (providesmpstat,pidstat,iostat, andsar)bccommand (for floating-point calculations)
-
Save the script to a file (e.g.,
sysperf.sh) -
Make it executable:
chmod +x sysperf.sh -
Install required dependencies (if not already installed):
For Debian/Ubuntu:
sudo apt-get update sudo apt-get install sysstat bcFor Red Hat/CentOS/Fedora:
sudo yum install sysstat bcor
sudo dnf install sysstat bcFor SUSE/openSUSE:
sudo zypper install sysstat bcFor Arch Linux:
sudo pacman -S sysstat bc
Run the script from the command line:
./sysperf.sh
For complete information (recommended), run with sudo:
sudo ./sysperf.sh
- Normal User: Most checks will work, but some system information may be limited
- Sudo/Root: Full access to all system metrics, recommended for comprehensive analysis
The script uses color-coded output to highlight potential issues:
- Green: Normal/good values
- Yellow: Warning levels that may require monitoring
- Red: Critical values indicating potential performance problems
- Blue: Section headers and informational text
You can modify the script to:
- Adjust threshold values for warnings and critical alerts
- Add additional checks specific to your environment
- Change the number of samples or sampling intervals
Based on Brendan Gregg's Linux Performance Checklist and performance analysis methodologies.
This script is provided under the MIT License. Feel free to modify and distribute as needed.