Show network statistics using sar command

sar command even shows network statistics. This can be done by using the -n DEV option in sar command.

clip_image002

clip_image004

 

IFACE: stands for the nic card interface name

rxpck/s: this shows the total packets received per second

txpck/s:transmitted packets per second

rxcmp/s: compressed packets received

txcmp/s: compressed packets transmitted

rxmcst/s: packets multicasted per second.

 

Show Memory usage in SAR command

clip_image006

clip_image008

 

Show CPU usage in SAR command

·         sar -P ALL Displays CPU usage broken down by all cores for the current day.

clip_image010

  • sar -P ALL 1 3 Displays real time CPU usage for ALL cores every 1 second for 3 times (broken down by all cores).
  • sar -P 1 Displays CPU usage for core number 1 for the current day.
  • sar -P 1 1 3 Displays real time CPU usage for core number 1, every 1 second for 3 times.
  • sar -P ALL -f /var/log/sa/sa10 Displays CPU usage broken down by all cores for the 10day day of the month from sa10 file.

Overall I/O Activities (sar -b)

This reports I/O statistics. “1 3″ reports for every 1 seconds a total of 3 times.

Following fields are displays in the example below.

·         tps – Transactions per second (this includes both read and write)

·         rtps – Read transactions per second

·         wtps – Write transactions per second

·         bread/s – Bytes read per second

bwrtn/s – Bytes written per second

clip_image012

clip_image014

 

Individual Block Device I/O Activities (sar -d)

To identify the activities by the individual block devices (i.e a specific mount point, or LUN, or partition), use “sar -d”

clip_image016

Display context switch per second (sar -w)

This reports the total number of processes created per second, and total number of context switches per second. “1 3″ reports for every 1 seconds a total of 3 times.

 

clip_image018

 

Analyzing past System performance of a Linux server
Case:-
Today’s date is 17th Dec 2012.
You are asked to check the System performance of a Linux server on 7th Dec,2012 between 1 AM to 5 AM.

# To check CPU utilization
# sar -u -f /var/log/sa/sa07 -s 01:00:01 -e 05:00:01

clip_image020

… # To check Memory status
#sar -r -f /var/log/sa/sa07 -s 01:00:01 -e 05:00:01

clip_image022

# To check Load average
#sar -q -f /var/log/sa/sa07 -s 01:00:01 -e 05:00:01

clip_image024

# To check Network status
#sar -n DEV -f /var/log/sa/sa07 -s 01:00:01 -e 05:00:01

clip_image026

 

Leave a Reply