• Contact
  • Contact Us
  • Disclamer
  • Home 1
  • Home 2
  • Home 3
  • Privacy Policy
Friday, May 9, 2025
How VPS - How to use/setup VPS
  • Login
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon
No Result
View All Result
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon
No Result
View All Result
How VPS - How to use/setup VPS
No Result
View All Result
Home Operating System Linux

Use Sar To Monitor System Performance

How VPS by How VPS
January 1, 2020
in Linux
0
0
SHARES
79
VIEWS
Share on FacebookShare on Twitter

Contents

  1. Prerequisites
  2. Installing the sysstat package
  3. Launching the sysstat service
  4. Using sar to get system performance statistics
    1. Display the CPU performance for 4 times with the interval of 1 second:
    2. Output the CPU performance statistics once per second until you press Ctrl-C to cancel:
    3. Show performance statistics for CPU (-u), memory (-r), swap space (-S), and I/O (-d):
    4. Show performance statistics for the network interface:
    5. Save the statistics into a specified file /~/sar.log:
  5. Conclusion
  6. Want to contribute?


sar is a multi-purpose system performance monitoring utility which is part of the sysstat package. With sar, you can collect, report, or save various types of system activities such as CPU, RAM, I/O, Disk usage, etc.

In this article, we will be covering the process of installing and using sar to monitor system performance.

Prerequisites

  • An instance running CentOS 7 x64.
  • A sudo user.

Installing the sysstat package

In order to use sar, you need to install the sysstat package. However, it is a good practice to first update your system’s packages if you haven’t done so in a while.

sudo yum update
sudo shutdown -r now

Download and install the latest stable version of sysstat from its official website:

cd ~
wget http://pagesperso-orange.fr/sebastien.godard/sysstat-11.2.0-1.x86_64.rpm
sudo yum install sysstat-11.2.0-1.x86_64.rpm

Launching the sysstat service

sudo systemctl enable sysstat
sudo systemctl start sysstat

Using sar to get system performance statistics

In short, the usage of the sar command is:

sar [ options ] [ <interval> [ <count> ] ]

The options of sar cover every nook and corner of the system, main options include:

-B                               Paging statistics
-b                               I/O and transfer rate statistics
-d                               Block devices statistics
-F [ MOUNT ]                     Filesystems statistics
-H                               Hugepages utilization statistics
-I { <int> | SUM | ALL | XALL }  Interrupts statistics
-m { <keyword> [,...] | ALL }    Power management statistics
-n { <keyword> [,...] | ALL }
-q                               Queue length and load average statistics
-R                               Memory statistics
-r [ ALL ]                       Memory utilization statistics
-S                               Swap space utilization statistics
-u [ ALL ]                       CPU utilization statistics
-v                               Kernel tables statistics
-W                               Swapping statistics
-w                               Task creation and system switching statistics
-y                               TTY devices statistics

For the purpose of this tutorial, we will be only covering some of the most common usage cases for sar.

Display the CPU performance for 4 times with the interval of 1 second:

sar 1 4

OR

sar -u 1 4

By default, sar will display the CPU performance report if no parameters were specified.

Output the CPU performance statistics once per second until you press Ctrl-C to cancel:

sar 1

In this example, only the interval is specified, the number of repetitions is not.

Show performance statistics for CPU (-u), memory (-r), swap space (-S), and I/O (-d):

sar -urSbd 1

Show performance statistics for the network interface:

sar -n DEV 1

Save the statistics into a specified file /~/sar.log:

sar -u -r -o ~/sar.log 1

Conclusion

sar is a versatile command, only a few of its usage examples are mentioned in this article. You can learn more about it by inputting sar -h or visiting its official home page.

Thank you for reading.

Want to contribute?

You could earn up to $300 by adding new articles

Submit your article
Suggest an update
Request an article
Previous Post

How To Install XCache on Ubuntu 15.04

Next Post

How to Deploy Ghost v0.11 LTS on Ubuntu 16.04

Next Post

How to Deploy Ghost v0.11 LTS on Ubuntu 16.04

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

No Result
View All Result

Recent Post

Install Imagemagick on CentOS
CentOS

Install Imagemagick on CentOS

by How VPS
June 28, 2023
0

This is how I installed Imagemagick on a vanilla CentOS server Start off by installing the prerequisites yum install php-pear...

Read more
how to Check phpinfo

How to Check phpinfo of Hosting or VPS?

June 28, 2023
Failed to download metadata for repo 'appstream' on Centos 8

How to fix error: Failed to download metadata for repo ‘appstream’ on Centos 8

February 25, 2022
How to Fix MySQL Error "Plugin 'InnoDB' registration as a STORAGE ENGINE failed"?

How to Fix MySQL Error “Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed”?

November 17, 2020
How to optimize Mysql or MariaDB

How to optimize Mysql or MariaDB

November 3, 2020

Recent News

  • Install Imagemagick on CentOS
  • How to Check phpinfo of Hosting or VPS?
  • How to fix error: Failed to download metadata for repo ‘appstream’ on Centos 8

Category

  • Arch
  • Authentication
  • Backups
  • BSD
  • Centmin Mod
  • CentOS
  • Control Panels
  • CoreOS
  • CWP
  • Debian
  • Directadmin
  • Encryption
  • Fedora
  • Firewalls
  • Hocvps Script
  • Hosting providers
  • Kloxo-MR
  • Linux
  • Mitigations
  • Operating System
  • Plesk
  • Reviews
  • Securing VPS/Servers
  • Security Patches
  • SSL Certificates
  • Uncategorized
  • Upgrading
  • VPS/Servers management guides
  • Vulnerability Detection
  • Web servers software
  • Webhosting Control Panel
  • About
  • Advertise
  • Careers
  • Contact

© 2025 JNews - Premium WordPress news & magazine theme by Jegtheme.

No Result
View All Result
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon

© 2025 JNews - Premium WordPress news & magazine theme by Jegtheme.

Welcome Back!

Login to your account below

Forgotten Password?

Retrieve your password

Please enter your username or email address to reset your password.

Log In
Thabet