Resource icon

SAR - Linux Utility for System Monitoring

  • perf-test.com need your contributions to build up a strong repository of performance engineering resources.

Using sar you can monitor performance of various Linux subsystems (CPU, Memory, I/O..) in real time.


Using sar, you can also collect all performance data on an on-going basis, store them, and do historical analysis to identify bottlenecks.
Sar is part of the sysstat package.

Below are the Linux performance statistics using sar. (along with argument)


  1. Collective CPU usage --> sar -u
  2. Individual CPU statistics --> sar -u -P ALL
  3. Memory used and available --> sar -r
  4. Swap space used and available --> sar -S
  5. Overall I/O activities of the system --> sar -b
  6. Individual device I/O activities --> sar -d
  7. Context switch statistics --> sar -w
  8. Run queue and load average data --> sar -q
  9. Network statistics --> sar -n
  10. Report sar data from a specific time --> sar -s

Useful Link:

http://www.thegeekstuff.com/2011/03/sar-examples/


Useful Note:

  • Based on the linux configuration, sar data get stored in below location in linux server for few days (by default for 1 month)
/var/log/sa/saXX --> where XX is date of month

  • To get the CPU utilization of particular date, below command can be run.
For example: for 5th of this month

sar -u -P ALL -f /var/log/sa/sa05

  • If one wants to get data for particular timeframe
sar –u –P ALL –s 02:00:00 –e 03:00:00 –f /var/log/sa/sa05

upload_2016-1-5_20-52-17.png


Similarly one can get other metrics also like memory. disk i/o.
Author
Aditya Srivastava
Views
60
First release
Last update
Rating
0.00 star(s) 0 ratings

More resources from Aditya Srivastava