{"id":221,"date":"2014-04-15T16:56:10","date_gmt":"2014-04-15T16:56:10","guid":{"rendered":"https:\/\/qbytes.cloud\/?p=221"},"modified":"2014-04-15T16:56:10","modified_gmt":"2014-04-15T16:56:10","slug":"installing-and-configuring-sysstat-on-centos-6","status":"publish","type":"post","link":"https:\/\/www.qbytes.cloud\/index.php\/2014\/04\/15\/installing-and-configuring-sysstat-on-centos-6\/","title":{"rendered":"Installing and configuring sysstat on CentOS 8"},"content":{"rendered":"\n<p>Sysstat is a package of performance monitoring tools for Linux operating systems. It provides a collection of utilities to collect, process and analyze system utilization data over time. The sysstat package includes tools like sar, iostat, mpstat, and pidstat, which provide various system performance metrics such as CPU, memory, disk and network usage, process statistics, and more. The data collected by sysstat can be used to identify performance bottlenecks, troubleshoot system issues, and make informed decisions about system resource usage.<\/p>\n\n\n\n<p>This article shows how to install sysstat and to check the system.<\/p>\n\n\n\n<!--more-->\n\n\n\n<p><strong>Overview<\/strong><\/p>\n\n\n\n<p>The SYSSTAT software application is composed of several utilities. Each utility has a specific function:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>iostat reports CPU statistics and input\/output statistics for devices, partitions and network filesystems.<\/li>\n\n\n\n<li>mpstat reports individual or combined processor related statistics.<\/li>\n\n\n\n<li>pidstat reports statistics for Linux tasks (processes) : I\/O, CPU, memory, etc.<\/li>\n\n\n\n<li>sar collects, reports and saves system activity information (CPU, memory, disks, interrupts, network interfaces, TTY, kernel tables, NFS, sockets etc.)<\/li>\n\n\n\n<li>sadc is the system activity data collector, used as a backend for sar.<\/li>\n\n\n\n<li>sa1 collects and stores binary data in the system activity daily data file. It is a front end to sadc designed to be run from cron.<\/li>\n\n\n\n<li>sa2 writes a summarized daily activity report. It is a front end to sar designed to be run from cron.<\/li>\n\n\n\n<li>sadf displays data collected by sar in multiple formats (CSV, XML, etc.) This is useful to load performance data into a database, or import them in a spreadsheet to make graphs.<\/li>\n<\/ul>\n\n\n\n<p>Let&#8217;s start by installing Sysstat<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nyum -y install sysstat\n<\/pre><\/div>\n\n\n<p>Enable Sysstat<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nsystemctl enable sysstat\n<\/pre><\/div>\n\n\n<p>Check the cron job<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\ncat \/etc\/cron.d\/sysstat\n<\/pre><\/div>\n\n\n<p>Output<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\ncat \/etc\/cron.d\/sysstat\n<\/pre><\/div>\n\n\n<p>Output:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n# The first element of the path is a directory where the debian-sa1\n# script is located\nPATH=\/usr\/lib\/sysstat:\/usr\/sbin:\/usr\/sbin:\/usr\/bin:\/sbin:\/bin\n\n# Activity reports every 10 minutes everyday\n5-55\/10 * * * * root command -v debian-sa1 &gt; \/dev\/null &amp;amp;&amp;amp; debian-sa1 1 1\n\n# Additional run at 23:59 to rotate the statistics file\n59 23 * * * root command -v debian-sa1 &gt; \/dev\/null &amp;amp;&amp;amp; debian-sa1 60 2\n<\/pre><\/div>\n\n\n<p>Enable SADC<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nnano \/etc\/default\/sysstat\n<\/pre><\/div>\n\n\n<p>Output<\/p>\n\n\n\n<p>Change ENABLED=&#8221;false&#8221; to ENABLED=&#8221;true&#8221;. Then start sysstat.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n#\n# Default settings for \/etc\/init.d\/sysstat, \/etc\/cron.d\/sysstat\n# and \/etc\/cron.daily\/sysstat files\n#\n\n# Should sadc collect system activity informations? Valid values\n# are \"true\" and \"false\". Please do not put other values, they\n# will be overwritten by debconf!\nENABLED=\"true\"\n<\/pre><\/div>\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nsystemctl restart sysstat\n<\/pre><\/div>\n\n\n<p><strong>Usage Examples<\/strong><\/p>\n\n\n\n<p>NOTE: Sysstat takes time to gather data. If you see no real output from the below commands, give the system time to generate data.<\/p>\n\n\n\n<p>View RAM usage<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nsar -r\n<\/pre><\/div>\n\n\n<p>Output<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nLinux 5.10.0-21-amd64 (dns.ipgw.io)     03\/13\/2023      _x86_64_        (1 CPU)\n\n06:58:35 PM  LINUX RESTART      (1 CPU)\n\n07:00:09 PM kbmemfree   kbavail kbmemused  %memused kbbuffers  kbcached  kbcommit   %commit  kbactive   kbinact   kbdirty\n07:10:09 PM   1277964   1627632    240072     11.82     23992    438200   1097844     36.24    161488    493468       132\n07:20:01 PM   1277696   1627448    240244     11.83     24072    438204   1098864     36.28    161572    494000       156\n07:30:09 PM   1277428   1627272    240424     11.84     24160    438204   1098016     36.25    161656    493696       176\nAverage:      1277696   1627451    240247     11.83     24075    438203   1098241     36.26    161572    493721       155\n<\/pre><\/div>\n\n\n<p>View Swap usage<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nsar -S\n<\/pre><\/div>\n\n\n<p>Output<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nLinux 5.10.0-21-amd64 (dns.ipgw.io)     03\/13\/2023      _x86_64_        (1 CPU)\n\n06:58:35 PM  LINUX RESTART      (1 CPU)\n\n07:00:09 PM kbswpfree kbswpused  %swpused  kbswpcad   %swpcad\n07:10:09 PM    998396         0      0.00         0      0.00\n07:20:01 PM    998396         0      0.00         0      0.00\n07:30:09 PM    998396         0      0.00         0      0.00\nAverage:       998396         0      0.00         0      0.00\n\n<\/pre><\/div>\n\n\n<p>It\u2019s possible to output current or past status of system with \u201csar\u201d command like follows. Output the past CPU usage from the log file.<\/p>\n\n\n\n<p>Find the current file:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nls -l \/var\/log\/sysstat\/\ntotal 8\n-rw-r--r-- 1 root root 4792 Mar 13 19:10 sa13\n<\/pre><\/div>\n\n\n<p>The log file is &#8220;sa13.&#8221; Run the following:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nsar -u -f \/var\/log\/sysstat\/sa13\n<\/pre><\/div>\n\n\n<p>Output:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nLinux 5.10.0-21-amd64 (dns.ipgw.io)     03\/13\/2023      _x86_64_        (1 CPU)\n\n06:58:35 PM  LINUX RESTART      (1 CPU)\n\n07:00:09 PM     CPU     %user     %nice   %system   %iowait    %steal     %idle\n07:10:09 PM     all      0.03      0.00      0.02      0.03      0.01     99.91\n07:20:01 PM     all      0.02      0.00      0.02      0.02      0.02     99.93\n07:30:09 PM     all      0.02      0.00      0.02      0.02      0.01     99.93\nAverage:        all      0.02      0.00      0.02      0.02      0.01     99.92\n<\/pre><\/div>\n\n\n<p>Output the current CPU usage for 3 times every second.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nsar -u 1 3\n<\/pre><\/div>\n\n\n<p>Output<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nLinux 2.6.32-358.6.2.el6.x86_64 (dlp.server.world)      06\/24\/2013      _x86_64_        (2 CPU)\n\n05:29:12 PM     CPU     %user     %nice   %system   %iowait    %steal     %idle\n05:29:13 PM     all      0.00      0.00      0.00      0.00      0.00    100.00\n05:29:14 PM     all      0.00      0.00      0.00      0.00      0.50     99.50\n05:29:15 PM     all      0.50      0.00      0.50      0.00      0.00     99.00\nAverage:        all      0.17      0.00      0.17      0.00      0.17     99.50\n<\/pre><\/div>\n\n\n<p>Output the current Disk usage for 3 times every second.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nsar -b 1 3\n<\/pre><\/div>\n\n\n<p>Output:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nLinux 5.10.0-21-amd64 (dns.ipgw.io)     03\/13\/2023      _x86_64_        (1 CPU)\n\n07:37:20 PM       tps      rtps      wtps      dtps   bread\/s   bwrtn\/s   bdscd\/s\n07:37:21 PM      0.00      0.00      0.00      0.00      0.00      0.00      0.00\n07:37:22 PM      0.00      0.00      0.00      0.00      0.00      0.00      0.00\n07:37:23 PM      0.00      0.00      0.00      0.00      0.00      0.00      0.00\nAverage:         0.00      0.00      0.00      0.00      0.00      0.00      0.00\n<\/pre><\/div>\n\n\n<p>Output the current Memory usage for 3 times every second.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nsar -r 1 3\n<\/pre><\/div>\n\n\n<p>Output<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nLinux 5.10.0-21-amd64 (dns.ipgw.io)     03\/13\/2023      _x86_64_        (1 CPU)\n\n07:37:45 PM kbmemfree   kbavail kbmemused  %memused kbbuffers  kbcached  kbcommit   %commit  kbactive   kbinact   kbdirty\n07:37:46 PM   1277404   1627348    240340     11.84     24224    438232   1098380     36.26    161744    493800         0\n07:37:47 PM   1277404   1627348    240340     11.84     24224    438232   1098380     36.26    161744    493800         0\n07:37:48 PM   1277404   1627348    240340     11.84     24224    438232   1098380     36.26    161744    493800         0\nAverage:      1277404   1627348    240340     11.84     24224    438232   1098380     36.26    161744    493800         0\n<\/pre><\/div>\n\n\n<p>Output the current send\/receive packets for 3 times every second.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nsar -n DEV 1 3\n<\/pre><\/div>\n\n\n<p>Output:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nLinux 5.10.0-21-amd64 (dns.ipgw.io)     03\/13\/2023      _x86_64_        (1 CPU)\n\n07:19:58 PM     IFACE   rxpck\/s   txpck\/s    rxkB\/s    txkB\/s   rxcmp\/s   txcmp\/s  rxmcst\/s   %ifutil\n07:19:59 PM        lo      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00\n07:19:59 PM    enp1s0      2.00      0.00      0.11      0.00      0.00      0.00      0.00      0.00\n\n07:19:59 PM     IFACE   rxpck\/s   txpck\/s    rxkB\/s    txkB\/s   rxcmp\/s   txcmp\/s  rxmcst\/s   %ifutil\n07:20:00 PM        lo      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00\n07:20:00 PM    enp1s0      1.00      1.00      0.06      0.62      0.00      0.00      0.00      0.00\n\n07:20:00 PM     IFACE   rxpck\/s   txpck\/s    rxkB\/s    txkB\/s   rxcmp\/s   txcmp\/s  rxmcst\/s   %ifutil\n07:20:01 PM        lo      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00\n07:20:01 PM    enp1s0      2.00      1.00      0.11      0.62      0.00      0.00      0.00      0.00\n\nAverage:        IFACE   rxpck\/s   txpck\/s    rxkB\/s    txkB\/s   rxcmp\/s   txcmp\/s  rxmcst\/s   %ifutil\nAverage:           lo      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00\nAverage:       enp1s0      1.67      0.67      0.09      0.41      0.00      0.00      0.00      0.00\n\n<\/pre><\/div>\n\n\n<p>Output the current paging usage for 3 times every second.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nsar -B 1 3\n<\/pre><\/div>\n\n\n<p>Output<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n07:22:09 PM  pgpgin\/s pgpgout\/s   fault\/s  majflt\/s  pgfree\/s pgscank\/s pgscand\/s pgsteal\/s    %vmeff\n07:22:10 PM      0.00      0.00      0.00      0.00     33.00      0.00      0.00      0.00      0.00\n07:22:11 PM      0.00      0.00      0.00      0.00      1.00      0.00      0.00      0.00      0.00\n07:22:12 PM      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00\nAverage:         0.00      0.00      0.00      0.00     11.33      0.00      0.00      0.00      0.00\n\n<\/pre><\/div>\n\n\n<p>It&#8217;s possible to output every CPU cores&#8217; usage with &#8220;mpstat&#8221; command like follows. Output the current all CPU cores&#8217; usage for 3 times every second.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nmpstat -P ALL 1 3\n<\/pre><\/div>\n\n\n<p>Output<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nLinux 5.10.0-21-amd64 (dns.ipgw.io)     03\/13\/2023      _x86_64_        (1 CPU)\n\n07:24:09 PM  CPU    %usr   %nice    %sys %iowait    %irq   %soft  %steal  %guest  %gnice   %idle\n07:24:10 PM  all    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00\n07:24:10 PM    0    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00\n\n07:24:10 PM  CPU    %usr   %nice    %sys %iowait    %irq   %soft  %steal  %guest  %gnice   %idle\n07:24:11 PM  all    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00\n07:24:11 PM    0    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00\n\n07:24:11 PM  CPU    %usr   %nice    %sys %iowait    %irq   %soft  %steal  %guest  %gnice   %idle\n07:24:12 PM  all    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00\n07:24:12 PM    0    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00\n\nAverage:     CPU    %usr   %nice    %sys %iowait    %irq   %soft  %steal  %guest  %gnice   %idle\nAverage:     all    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00\nAverage:       0    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00\n\n<\/pre><\/div>\n\n\n<p>It&#8217;s possible to output disk I\/O usage with &#8220;iostat&#8221; command like follows. Output the current I\/O usage with Mega-bytes for 3 times every second.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\niostat -mx 1 3\n<\/pre><\/div>\n\n\n<p>Output<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nLinux 5.10.0-21-amd64 (dns.ipgw.io)     03\/13\/2023      _x86_64_        (1 CPU)\n\navg-cpu:  %user   %nice %system %iowait  %steal   %idle\n           0.07    0.00    0.09    0.23    0.01   99.60\n\nDevice            r\/s     rMB\/s   rrqm\/s  %rrqm r_await rareq-sz     w\/s     wMB\/s   wrqm\/s  %wrqm w_await wareq-sz     d\/s     dMB\/s   drqm\/s  %drqm d_await dareq-sz     f\/s f_await  aqu-sz  %util\nloop0            0.00      0.00     0.00   0.00   55.08    21.62    0.00      0.00     0.00   0.00    0.00     0.00    0.00      0.00     0.00   0.00    0.00     0.00    0.00    0.00    0.00   0.01\nloop1            0.05      0.00     0.00   0.00    6.78    29.62    0.00      0.00     0.00   0.00    0.00     0.00    0.00      0.00     0.00   0.00    0.00     0.00    0.00    0.00    0.00   0.04\nloop2            0.00      0.00     0.00   0.00   28.70     7.24    0.00      0.00     0.00   0.00    0.00     0.00    0.00      0.00     0.00   0.00    0.00     0.00    0.00    0.00    0.00   0.01\nloop3            0.00      0.00     0.00   0.00   31.74     8.05    0.00      0.00     0.00   0.00    0.00     0.00    0.00      0.00     0.00   0.00    0.00     0.00    0.00    0.00    0.00   0.01\nloop4            0.00      0.00     0.00   0.00    0.00     1.50    0.00      0.00     0.00   0.00    0.00     0.00    0.00      0.00     0.00   0.00    0.00     0.00    0.00    0.00    0.00   0.00\nsr0              0.00      0.00     0.00   0.00    0.11     0.17    0.00      0.00     0.00   0.00    0.00     0.00    0.00      0.00     0.00   0.00    0.00     0.00    0.00    0.00    0.00   0.00\nvda              0.60      0.03     0.23  27.39   15.19    46.77    0.32      0.01     0.32  49.34    5.36    19.55    0.00      0.00     0.00   0.00    0.00     0.00    0.05   17.73    0.01   0.30\n\n\navg-cpu:  %user   %nice %system %iowait  %steal   %idle\n           1.00    0.00    1.00    0.00    0.00   98.00\n\nDevice            r\/s     rMB\/s   rrqm\/s  %rrqm r_await rareq-sz     w\/s     wMB\/s   wrqm\/s  %wrqm w_await wareq-sz     d\/s     dMB\/s   drqm\/s  %drqm d_await dareq-sz     f\/s f_await  aqu-sz  %util\nloop0            0.00      0.00     0.00   0.00    0.00     0.00    0.00      0.00     0.00   0.00    0.00     0.00    0.00      0.00     0.00   0.00    0.00     0.00    0.00    0.00    0.00   0.00\nloop1            0.00      0.00     0.00   0.00    0.00     0.00    0.00      0.00     0.00   0.00    0.00     0.00    0.00      0.00     0.00   0.00    0.00     0.00    0.00    0.00    0.00   0.00\nloop2            0.00      0.00     0.00   0.00    0.00     0.00    0.00      0.00     0.00   0.00    0.00     0.00    0.00      0.00     0.00   0.00    0.00     0.00    0.00    0.00    0.00   0.00\nloop3            0.00      0.00     0.00   0.00    0.00     0.00    0.00      0.00     0.00   0.00    0.00     0.00    0.00      0.00     0.00   0.00    0.00     0.00    0.00    0.00    0.00   0.00\nloop4            0.00      0.00     0.00   0.00    0.00     0.00    0.00      0.00     0.00   0.00    0.00     0.00    0.00      0.00     0.00   0.00    0.00     0.00    0.00    0.00    0.00   0.00\nsr0              0.00      0.00     0.00   0.00    0.00     0.00    0.00      0.00     0.00   0.00    0.00     0.00    0.00      0.00     0.00   0.00    0.00     0.00    0.00    0.00    0.00   0.00\nvda              0.00      0.00     0.00   0.00    0.00     0.00    0.00      0.00     0.00   0.00    0.00     0.00    0.00      0.00     0.00   0.00    0.00     0.00    0.00    0.00    0.00   0.00\n\n\navg-cpu:  %user   %nice %system %iowait  %steal   %idle\n           0.00    0.00    0.00    0.00    0.00  100.00\n\nDevice            r\/s     rMB\/s   rrqm\/s  %rrqm r_await rareq-sz     w\/s     wMB\/s   wrqm\/s  %wrqm w_await wareq-sz     d\/s     dMB\/s   drqm\/s  %drqm d_await dareq-sz     f\/s f_await  aqu-sz  %util\nloop0            0.00      0.00     0.00   0.00    0.00     0.00    0.00      0.00     0.00   0.00    0.00     0.00    0.00      0.00     0.00   0.00    0.00     0.00    0.00    0.00    0.00   0.00\nloop1            0.00      0.00     0.00   0.00    0.00     0.00    0.00      0.00     0.00   0.00    0.00     0.00    0.00      0.00     0.00   0.00    0.00     0.00    0.00    0.00    0.00   0.00\nloop2            0.00      0.00     0.00   0.00    0.00     0.00    0.00      0.00     0.00   0.00    0.00     0.00    0.00      0.00     0.00   0.00    0.00     0.00    0.00    0.00    0.00   0.00\nloop3            0.00      0.00     0.00   0.00    0.00     0.00    0.00      0.00     0.00   0.00    0.00     0.00    0.00      0.00     0.00   0.00    0.00     0.00    0.00    0.00    0.00   0.00\nloop4            0.00      0.00     0.00   0.00    0.00     0.00    0.00      0.00     0.00   0.00    0.00     0.00    0.00      0.00     0.00   0.00    0.00     0.00    0.00    0.00    0.00   0.00\nsr0              0.00      0.00     0.00   0.00    0.00     0.00    0.00      0.00     0.00   0.00    0.00     0.00    0.00      0.00     0.00   0.00    0.00     0.00    0.00    0.00    0.00   0.00\nvda              0.00      0.00     0.00   0.00    0.00     0.00    0.00      0.00     0.00   0.00    0.00     0.00    0.00      0.00     0.00   0.00    0.00     0.00    0.00    0.00    0.00   0.00\n<\/pre><\/div>\n\n\n<p>It&#8217;s possible to output every CPU usage for processes with &#8220;pidstat&#8221; command like follows. Output the CPU usage for a process ID &#8220;1169&#8221; for 3 times every second.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\npidstat -p 1169 1 3\n<\/pre><\/div>\n\n\n<p>Output<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nLinux 5.10.0-21-amd64 (dns.ipgw.io)     03\/13\/2023      _x86_64_        (1 CPU)\n\n04:09:09 PM       PID    %usr %system  %guest    %CPU   CPU  Command\n04:09:10 PM      1169    0.00    0.00    0.00    0.00     1  bash\n04:09:11 PM      1169    0.00    0.00    0.00    0.00     1  bash\n04:09:12 PM      1169    0.00    0.00    0.00    0.00     1  bash\nAverage:         1169    0.00    0.00    0.00    0.00     -  bash\n<\/pre><\/div>\n\n\n<p>Viewing current processes<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\npidstat -d\n<\/pre><\/div>\n\n\n<p>Output<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nLinux 5.10.0-21-amd64 (dns.ipgw.io)     03\/13\/2023      _x86_64_        (1 CPU)\n\n08:07:05 PM   UID       PID   kB_rd\/s   kB_wr\/s kB_ccwr\/s iodelay  Command\n08:07:05 PM     0         1      6.38      0.01      0.00     375  systemd\n08:07:05 PM     0       141      0.00      0.00      0.00       1  kworker\/0:3-events\n08:07:05 PM     0       173      0.00      0.52      0.00    1466  jbd2\/vda1-8\n08:07:05 PM     0       212      0.46      0.97      0.00     403  systemd-journal\n08:07:05 PM     0       241      1.20      0.00      0.00      28  systemd-udevd\n08:07:05 PM     0       246      0.09      0.00      0.00     162  loop0\n08:07:05 PM     0       248      1.21      0.00      0.00     410  loop1\n08:07:05 PM     0       249      0.04      0.00      0.00     141  loop2\n08:07:05 PM     0       250      0.04      0.00      0.00     136  loop3\n08:07:05 PM   104       446      0.05      0.00      0.00      28  systemd-timesyn\n08:07:05 PM     0       449      0.01      0.00      0.00      18  cron\n08:07:05 PM   103       450      0.06      0.00      0.00      92  dbus-daemon\n08:07:05 PM     0       455      0.12      0.00      0.00     126  qemu-ga\n08:07:05 PM     0       456      0.11      0.04      0.00      84  rsyslogd\n08:07:05 PM     0       457      2.01      0.18      0.00     608  snapd\n08:07:05 PM     0       459      0.02      0.00      0.00      21  systemd-logind\n08:07:05 PM   108       462      1.74      0.01      0.00     401  zabbix_agent2\n08:07:05 PM     0       463      0.02      0.00      0.00      33  agetty\n08:07:05 PM   106       538      4.35      0.00      0.00     645  mariadbd\n08:07:05 PM     0       565      0.66      0.00      0.00       0  sshd\n08:07:05 PM     0       575      0.37      0.00      0.00     463  apache2\n08:07:05 PM     0      1296      5.93      2.93      0.12       0  bash\n08:07:05 PM     0      2255      0.00      0.00      0.00       1  kworker\/u2:0-events_u\n<\/pre><\/div>","protected":false},"excerpt":{"rendered":"<p>Sysstat is a package of performance monitoring tools for Linux operating systems. It provides a collection of utilities to collect, process and analyze system utilization data over time. The sysstat package includes tools like sar, iostat, mpstat, and pidstat, which provide various system performance metrics such as CPU, memory, disk and network usage, process statistics, &#8230; <a title=\"Installing and configuring sysstat on CentOS 8\" class=\"read-more\" href=\"https:\/\/www.qbytes.cloud\/index.php\/2014\/04\/15\/installing-and-configuring-sysstat-on-centos-6\/\" aria-label=\"Read more about Installing and configuring sysstat on CentOS 8\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[112],"tags":[],"class_list":["post-221","post","type-post","status-publish","format-standard","hentry","category-sysstat"],"_links":{"self":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts\/221","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/comments?post=221"}],"version-history":[{"count":0,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts\/221\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/media?parent=221"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/categories?post=221"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/tags?post=221"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}