{"id":193,"date":"2015-04-27T13:28:11","date_gmt":"2015-04-27T13:28:11","guid":{"rendered":"http:\/\/betakb.veeble.org\/?p=193"},"modified":"2025-04-08T16:04:04","modified_gmt":"2025-04-08T10:34:04","slug":"load-memory-monitoring-using-sar","status":"publish","type":"post","link":"https:\/\/www.veeble.com\/kb\/load-memory-monitoring-using-sar\/","title":{"rendered":"Load &amp; Memory monitoring using SAR"},"content":{"rendered":"\n<p><b>Installation<\/b><\/p>\n\n\n\n<p>Install Sysstat Package<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo apt-get install sysstat\n<\/pre>\n\n\n\n<p>(or)<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">yum install sysstat\n<\/pre>\n\n\n\n<p>(or)<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">rpm -ivh sysstat-10.0.0-1.i586.rpm\n<\/pre>\n\n\n\n<p><b>sysstat<\/b> &#8211; daemon<\/p>\n\n\n\n<p>Using sar we can monitor performance of server(load, memory etc&#8230;) in real time.<\/p>\n\n\n\n<p><b>sar -q<\/b><\/p>\n\n\n\n<p>Report load average. (fetch data from \/var\/log\/sa(sysstat)\/sa*, where sa* represent the date like sa10,sa11,sa12etc.).<\/p>\n\n\n\n<p>Examples,<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sar -q (List current day's load averages starting from 12:00:00, with 10 minute interval).\nsar -q 1 5 (List load averages 5 times from when we enter this with an interval of 1 sec).\nsar -q -f \/var\/log\/sa\/sa23 (Fetch data from \/var\/log\/sa\/sa23).\n<\/pre>\n\n\n\n<p><b>sar -r<\/b><\/p>\n\n\n\n<p>Report memory details.<\/p>\n\n\n\n<p>Examples,<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sar -r (List current days memory usage from 12:00:00)\nsar -r 1 5 (List memory usage 5 times from when we enter this with an interval of 1 sec).\nsar -r -f \/var\/log\/sa\/sa23 (Fetch data from \/var\/log\/sa\/sa23).\n<\/pre>\n\n\n\n<p>Examples,<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ sar -q\nLinux 3.8.0-19-generic (ubuntu) \tTuesday 03 September 2013 \t_i686_\t(2 CPU)\n07:09:45  IST       LINUX RESTART\n07:15:01  IST   runq-sz  plist-sz   ldavg-1   ldavg-5  ldavg-15   blocked\n07:25:01  IST         0       451      0.43      0.41      0.35         0\n07:35:01  IST         0       469      0.51      0.45      0.41         1\n07:45:01  IST         0       457      0.37      0.40      0.41         0\n07:55:01  IST         0       460      0.22      0.26      0.34         0\n08:05:01  IST         0       464      0.39      0.44      0.39         0\n08:15:01  IST         1       464      0.29      0.35      0.36         0\n08:25:01  IST         0       462      0.10      0.22      0.29         0\n<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">$ sar -q 1 5\nLinux 3.8.0-19-generic (ubuntu) \tTuesday 03 September 2013 \t_i686_\t(2 CPU)\n08:11:31  IST   runq-sz  plist-sz   ldavg-1   ldavg-5  ldavg-15   blocked\n08:11:32  IST         0       837      0.37      0.28      0.26         0\n08:11:33  IST         0       837      0.37      0.28      0.26         0\n08:11:34  IST         1       836      0.37      0.28      0.26         0\n08:11:35  IST         0       837      0.37      0.28      0.26         0\n08:11:36  IST         0       837      0.34      0.27      0.26         0\nAverage:            0       837      0.36      0.28      0.26         0\n<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">$ sar -q -f \/var\/log\/sysstat\/sa31\nLinux 3.8.0-19-generic (ubuntu) \tSaturday 31 August 2013 \t_i686_\t(2 CPU)\n06:59:36  IST       LINUX RESTART\n07:05:01  IST   runq-sz  plist-sz   ldavg-1   ldavg-5  ldavg-15   blocked\n07:15:01  IST         0       441      0.08      0.33      0.37         0\n07:25:01  IST         0       444      0.55      0.51      0.43         0\n07:35:01  IST         0       440      0.34      0.43      0.41         0\n07:45:01  IST         1       450      1.18      0.68      0.50         0\n07:55:01  IST         1       451      1.18      1.39      0.97         1 \n<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">$ sar -r\nLinux 3.8.0-19-generic (ubuntu) \tTuesday 03 September 2013 \t_i686_\t(2 CPU)\n07:09:45  IST       LINUX RESTART\n07:15:01  IST kbmemfree kbmemused &nbsp;%memused kbbuffers  kbcached  kbcommit  &nbsp;%commit  kbactive   kbinact\n07:25:01  IST    474968   1328668     73.67     93124    594692   3337476     91.80    817932    369976\n07:35:01  IST    226048   1577588     87.47    105176    710308   3616268     99.47    917484    467908\n07:45:01  IST    209272   1594364     88.40    113476    706056   3566672     98.10    767164    621764\n07:55:01  IST    154132   1649504     91.45    112828    657796   3657940    100.62    726264    717876\n08:05:01  IST    170096   1633540     90.57    114240    625032   3770396    103.71    678192    729460\n08:15:01  IST    156800   1646836     91.31    115424    629584   3755640    103.30    771496    650268\n08:25:01  IST    222208   1581428     87.68    116728    633084   3763212    103.51    703540    652292 \n<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">$ sar -r 1 5\nLinux 3.8.0-19-generic (ubuntu) \tTuesday 03 September 2013 \t_i686_\t(2 CPU)\n07:41:24  IST kbmemfree kbmemused &nbsp;%memused kbbuffers  kbcached  kbcommit  &nbsp;%commit  kbactive   kbinact\n07:41:25  IST    121692   1681944     93.25      2820    217776   8251696    226.97    528212    528260\n07:41:26  IST    121692   1681944     93.25      2820    217776   8251696    226.97    528224    528260\n07:41:27  IST    121692   1681944     93.25      2820    217776   8251828    226.97    528232    528260\n07:41:28  IST    121320   1682316     93.27      2820    217776   8251828    226.97    528428    528260\n07:41:29  IST    121196   1682440     93.28      2828    217772   8251828    226.97    528652    528260\nAverage:       121518   1682118     93.26      2822    217775   8251775    226.97    528350    528260\n<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">$ sar -r -f \/var\/log\/sysstat\/sa31\nLinux 3.8.0-19-generic (ubuntu) \tSaturday 31 August 2013 \t_i686_\t(2 CPU)\n06:59:36  IST       LINUX RESTART\n07:05:01  IST kbmemfree kbmemused &nbsp;%memused kbbuffers  kbcached  kbcommit  &nbsp;%commit  kbactive   kbinact\n07:15:01  IST    275668   1527968     84.72     66944    710104   3369400     92.68    857776    470164\n07:25:01  IST    148320   1655316     91.78     99344    679552   3537784     97.31    710692    727292\n07:35:01  IST    166196   1637440     90.79    100840    685880   3463628     95.27    708924    711872\n07:45:01  IST    150544   1653092     91.65    102620    632148   3623020     99.65    703284    733340\n07:55:01  IST    175800   1627836     90.25     89196    561716   3711724    102.09    709260    702136\n<\/pre>\n\n\n\n<p>-r and -q is the commonly used SAR switches, Please refer to other switches too (-u, -v, -P, -d, -betc&#8230;)<\/p>\n\n\n\n<div style=\"height:25px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<div class=\"wp-block-uagb-call-to-action uagb-block-73408d54 wp-block-button\"><div class=\"uagb-cta__wrap\"><h3 class=\"uagb-cta__title\">Secure and Reliable Node.js Hosting for Your Critical Applications<\/h3><p class=\"uagb-cta__desc\">Trust Veeble for secure Node.js hosting. Free SSL, DDoS protection, and global servers. Your applications, protected and fast.<\/p><\/div><div class=\"uagb-cta__buttons\"><a href=\"https:\/\/www.veeble.com\/in\/nodejs-hosting\/\" class=\"uagb-cta__button-link-wrapper wp-block-button__link\" target=\"_blank\" rel=\"noopener noreferrer\">Explore Node.js Plans<svg xmlns=\"https:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\"><path d=\"M504.3 273.6l-112.1 104c-6.992 6.484-17.18 8.218-25.94 4.406c-8.758-3.812-14.42-12.45-14.42-21.1L351.9 288H32C14.33 288 .0002 273.7 .0002 255.1S14.33 224 32 224h319.9l0-72c0-9.547 5.66-18.19 14.42-22c8.754-3.809 18.95-2.075 25.94 4.41l112.1 104C514.6 247.9 514.6 264.1 504.3 273.6z\"><\/path><\/svg><\/a><\/div><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Installation Install Sysstat Package sudo apt-get install sysstat (or) yum install sysstat (or) rpm -ivh sysstat-10.0.0-1.i586.rpm sysstat &#8211; daemon Using sar we can monitor [&hellip;]<\/p>\n","protected":false},"author":10,"featured_media":8151,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_uag_custom_page_level_css":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"set","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[5],"tags":[],"class_list":["post-193","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux"],"uagb_featured_image_src":{"full":["https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2015\/04\/Load-Memory-monitoring-using-SAR.jpg",1366,768,false],"thumbnail":["https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2015\/04\/Load-Memory-monitoring-using-SAR-150x150.jpg",150,150,true],"medium":["https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2015\/04\/Load-Memory-monitoring-using-SAR-300x169.jpg",300,169,true],"medium_large":["https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2015\/04\/Load-Memory-monitoring-using-SAR-768x432.jpg",768,432,true],"large":["https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2015\/04\/Load-Memory-monitoring-using-SAR-1024x576.jpg",1024,576,true],"1536x1536":["https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2015\/04\/Load-Memory-monitoring-using-SAR.jpg",1366,768,false],"2048x2048":["https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2015\/04\/Load-Memory-monitoring-using-SAR.jpg",1366,768,false]},"uagb_author_info":{"display_name":"Vipin Raj","author_link":"https:\/\/www.veeble.com\/kb\/author\/vipin\/"},"uagb_comment_info":0,"uagb_excerpt":"Installation Install Sysstat Package sudo apt-get install sysstat (or) yum install sysstat (or) rpm -ivh sysstat-10.0.0-1.i586.rpm sysstat &#8211; daemon Using sar we can monitor [&hellip;]","_links":{"self":[{"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/posts\/193","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/users\/10"}],"replies":[{"embeddable":true,"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/comments?post=193"}],"version-history":[{"count":5,"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/posts\/193\/revisions"}],"predecessor-version":[{"id":8514,"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/posts\/193\/revisions\/8514"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/media\/8151"}],"wp:attachment":[{"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/media?parent=193"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/categories?post=193"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/tags?post=193"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}