1. SPEForums need your contributions to build up a strong repository of performance engineering resources.

    Dismiss Notice
  2. Whatsapp Group For Software Performance Engineering Professionals!! Click here to get added . No Spam for strictly professional discussions only.
    Dismiss Notice
Dismiss Notice
Hello Guest,

Please reach out to us at admin@speforums.com/+91 8600177662 in case you face any issues with SPEForums. Share your feedback - Click Here

Please support us by sharing performance engineering tutorials/resources with SPEForums.com

-Crew

SAR - Linux Utility for System Monitoring

SAR - Very useful System Monitoring Utility

  1. Aditya Srivastava
    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.