Table of Contents

Performance Monitoring

Sysstat

Basics

Most of the following info is from this very good article by Ramesh Natarajan Install with

yum install ssstat

The following gives the system CPU statistics 3 times (with 1 second interval).

sar 1 3

CPU Usage of Individual Cores

If you have 4 Cores on the machine and would like to see what the individual cores are doing, do the following. “-P ALL” indicates that it should displays statistics for ALL the individual Cores.

In the following example under “CPU” column 0, 1, 2, and 3 indicates the corresponding CPU core numbers.

sar -P ALL 1 1

“-P 1” indicates that it should displays statistics only for the 2nd Core. (Note that Core number starts from 0).

sar -P 1 1 1

Vmstat

Another utility that can’t be missing from your toolset is vmstat. It will allow you to see at a quick glance information about processes, CPU and memory usage, disk activity, and more.

If run without arguments, vmstat will return averages since the last reboot. While you may use this form of the command once in a while, it will be more helpful to take a certain amount of system utilization samples, one after another, with a defined time separation between samples.

The following will return 10 samples taken every 5 seconds

vmstat 5 10

Dstat

yum install dstat

Note that if run without arguments, dstat assumes -cdngy by default (short for CPU, disk, network, memory pages, and system stats, respectively), and adds one line every second (execution can be interrupted anytime with Ctrl + C):

To output the stats to a .csv file, use the –output flag followed by a file name.