{"id":1018,"date":"2019-03-15T04:29:22","date_gmt":"2019-03-15T04:29:22","guid":{"rendered":"http:\/\/orissawebhosting.in\/blog\/?p=1018"},"modified":"2019-06-23T14:17:41","modified_gmt":"2019-06-23T14:17:41","slug":"monitor-linux-systems-performance-with-iostat-command","status":"publish","type":"post","link":"https:\/\/orissawebhosting.in\/blog\/monitor-linux-systems-performance-with-iostat-command\/","title":{"rendered":"Monitor Linux Systems Performance with iostat command"},"content":{"rendered":"\n<p>iostat command is used to monitor CPU utilization and I\/O (input \/output) statistics of all the disks and file systems. nfsiostat command is used to monitor i\/o statistics of network file system(NFS).<\/p>\n\n\n\n<p>iostat command monitor the I\/O (Input\/Output) devices loading by means of observing the time, devices are active with respect to their average transfer rates. This command is especially helpful for generating reports that we can use to optimize the system\u2019s input &amp; output load.<\/p>\n\n\n\n<p>iostat command generally generates two reports:<\/p>\n\n\n\n<ul><li>CPU utilization report<\/li><li>All disks i\/o statistics report<\/li><\/ul>\n\n\n\n<p>To generate the reports, iostat command reads some of the system files . These files are,<\/p>\n\n\n\n<ul><li>\/proc\/diskstats for disk stats<\/li><li>\/proc\/stat for system stats<\/li><li>\/sys for block device stats<\/li><li>\/proc\/devices for persistent device names<\/li><li>\/proc\/self\/mountstats for all&nbsp; the network filesystems<\/li><li>\/proc\/uptime for information regarding system uptime<\/li><\/ul>\n\n\n\n<p>In this tutorial, we will learn how to install iostat utility on Linux systems and then we will discuss how to generate reports using iostat command,<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Iostat Installation on centos 7<\/h4>\n\n\n\n<p>\n\niostat is a part of \u2018<strong>sysstat<\/strong>\u2018 package, we can install it on our system using the following command,\n\n<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">yum install sysstat -y<\/pre>\n\n\n\n<p>\n\nNow let\u2019s check out some examples to understand the iostat command better.\n\n<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Example:1 Get complete statistics (CPU &amp; Devices)<\/h4>\n\n\n\n<p>\n\nTo get the complete statistics for the system, open terminal &amp; execute the following command,\n\n<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"> iostat<br><br><\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"855\" height=\"207\" src=\"http:\/\/orissawebhosting.in\/blog\/wp-content\/uploads\/2019\/04\/Capture.jpg\" alt=\"\" class=\"wp-image-1019\" srcset=\"https:\/\/orissawebhosting.in\/blog\/wp-content\/uploads\/2019\/04\/Capture.jpg 855w, https:\/\/orissawebhosting.in\/blog\/wp-content\/uploads\/2019\/04\/Capture-300x73.jpg 300w, https:\/\/orissawebhosting.in\/blog\/wp-content\/uploads\/2019\/04\/Capture-768x186.jpg 768w\" sizes=\"(max-width: 855px) 100vw, 855px\" \/><\/figure>\n\n\n\n<p>Here in the iostat command output,<\/p>\n\n\n\n<ul><li>%user, is CPU utilization for the user,<\/li><li>%nice, is the CPU utilization for apps with nice priority,<\/li><li>%system, is the CPU being utilized by the system,<\/li><li>%iowait, is the time percentage during which CPU was idle but there was an outstanding i\/o request,<\/li><li>%steal, percentage of time CPU was waiting as the hypervisor was working on another CPU,<\/li><li>%idle, is the percentage of time system was idle with no outstanding request.<\/li><\/ul>\n\n\n\n<p>Devices, shows the name of all the devices on system,<\/p>\n\n\n\n<ul><li>Tps, is the short for transfer per second,<\/li><li>Blk_read\/s &amp; Blk_write\/s are the transfer speed for read and write operations,<\/li><li>Blk_read &amp; Blk_write shows the total number of blocks read &amp; written.<\/li><\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">Example:2 Generate only CPU stats<\/h4>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"844\" height=\"146\" src=\"http:\/\/orissawebhosting.in\/blog\/wp-content\/uploads\/2019\/04\/Capture-2.jpg\" alt=\"\" class=\"wp-image-1023\" srcset=\"https:\/\/orissawebhosting.in\/blog\/wp-content\/uploads\/2019\/04\/Capture-2.jpg 844w, https:\/\/orissawebhosting.in\/blog\/wp-content\/uploads\/2019\/04\/Capture-2-300x52.jpg 300w, https:\/\/orissawebhosting.in\/blog\/wp-content\/uploads\/2019\/04\/Capture-2-768x133.jpg 768w\" sizes=\"(max-width: 844px) 100vw, 844px\" \/><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\">Example:3 To Generate i\/o statistics for all the devices (-d option)&nbsp;<\/h4>\n\n\n\n<p>\n\nTo get the iostat report only for the devices connected on the system, we will use option \u2018d\u2019 with iostat command,\n\n<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">iostat -d<br><br><\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"889\" height=\"172\" src=\"http:\/\/orissawebhosting.in\/blog\/wp-content\/uploads\/2019\/04\/Capture-3.jpg\" alt=\"\" class=\"wp-image-1024\" srcset=\"https:\/\/orissawebhosting.in\/blog\/wp-content\/uploads\/2019\/04\/Capture-3.jpg 889w, https:\/\/orissawebhosting.in\/blog\/wp-content\/uploads\/2019\/04\/Capture-3-300x58.jpg 300w, https:\/\/orissawebhosting.in\/blog\/wp-content\/uploads\/2019\/04\/Capture-3-768x149.jpg 768w\" sizes=\"(max-width: 889px) 100vw, 889px\" \/><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\">Example:4 Generate detailed i\/o statistics<\/h4>\n\n\n\n<p>\n\nThough usually the stats provide by iostat command are sufficient but if you wish to get even more detailed statistics, we can use \u2018-x\u2019 option along with iostat command. Example is shown below,\n\n<\/p>\n\n\n\n<p>iostat -x<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"213\" src=\"http:\/\/orissawebhosting.in\/blog\/wp-content\/uploads\/2019\/04\/Capture-4-1024x213.jpg\" alt=\"\" class=\"wp-image-1025\" srcset=\"https:\/\/orissawebhosting.in\/blog\/wp-content\/uploads\/2019\/04\/Capture-4-1024x213.jpg 1024w, https:\/\/orissawebhosting.in\/blog\/wp-content\/uploads\/2019\/04\/Capture-4-300x63.jpg 300w, https:\/\/orissawebhosting.in\/blog\/wp-content\/uploads\/2019\/04\/Capture-4-768x160.jpg 768w, https:\/\/orissawebhosting.in\/blog\/wp-content\/uploads\/2019\/04\/Capture-4.jpg 1065w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\">Example:5  Generate the LVM statistics report <\/h4>\n\n\n\n<pre class=\"wp-block-preformatted\"> iostat -N <\/pre>\n\n\n\n<p>These are the major iostat commands to Monitor Linux Systems Performance.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>iostat command is used to monitor CPU utilization and I\/O (input \/output) statistics of all the disks and file systems. nfsiostat command is used to monitor i\/o statistics of network file system(NFS). iostat command monitor the I\/O (Input\/Output) devices loading by means of observing the time, devices are active with respect to their average transfer rates. This command is especially helpful for generating reports that we can use to optimize the system\u2019s input &amp; output load. iostat command generally generates two reports: CPU utilization report All disks i\/o statistics report&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":true,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"_links":{"self":[{"href":"https:\/\/orissawebhosting.in\/blog\/wp-json\/wp\/v2\/posts\/1018"}],"collection":[{"href":"https:\/\/orissawebhosting.in\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/orissawebhosting.in\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/orissawebhosting.in\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/orissawebhosting.in\/blog\/wp-json\/wp\/v2\/comments?post=1018"}],"version-history":[{"count":4,"href":"https:\/\/orissawebhosting.in\/blog\/wp-json\/wp\/v2\/posts\/1018\/revisions"}],"predecessor-version":[{"id":1028,"href":"https:\/\/orissawebhosting.in\/blog\/wp-json\/wp\/v2\/posts\/1018\/revisions\/1028"}],"wp:attachment":[{"href":"https:\/\/orissawebhosting.in\/blog\/wp-json\/wp\/v2\/media?parent=1018"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/orissawebhosting.in\/blog\/wp-json\/wp\/v2\/categories?post=1018"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/orissawebhosting.in\/blog\/wp-json\/wp\/v2\/tags?post=1018"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}