{"id":13847,"date":"2019-04-06T11:26:40","date_gmt":"2019-04-06T11:26:40","guid":{"rendered":"http:\/\/www.appservgrid.com\/paw92\/?p=13847"},"modified":"2019-04-06T11:26:40","modified_gmt":"2019-04-06T11:26:40","slug":"guider-a-system-wide-linux-performance-analyzer","status":"publish","type":"post","link":"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/04\/06\/guider-a-system-wide-linux-performance-analyzer\/","title":{"rendered":"Guider \u2013 A System Wide Linux Performance Analyzer"},"content":{"rendered":"<p><strong>Guider<\/strong>\u00a0is a free and opens source, powerful system-wide performance analysis tool written mostly in\u00a0<strong>Python<\/strong>\u00a0for Linux operating systems.<\/p>\n<p>It is designed to measure amount of system resource usage and to trace system behavior thus making it easy to analyze system performance issues effectively or allow for performance tunning.<\/p>\n<p>It shows you a great wealth of information concerning CPU, memory, disk usage per thread, processes, system functions (user\/kernel); therefore making it really simple to get to the bottom of an issue causing abnormal system performance or to improve overall system performance.<\/p>\n<h4>System Requirements<\/h4>\n<ul>\n<li>Linux kernel (&gt;= 3.0)<\/li>\n<li>Python (&gt;= 2.7)<\/li>\n<li>Kernel buffer size of 40960.<\/li>\n<\/ul>\n<p>In this article, we will show you how to install guider from source and use it to analyze and improve overall Linux operating system performance.<\/p>\n<h3>How to Build and Install Guider \u2013 Linux Performance Analyzer<\/h3>\n<p>To install\u00a0<strong>Guider<\/strong>\u00a0on Linux, first clone the guider repository from github as shown.<\/p>\n<pre>$ git clone https:\/\/github.com\/iipeace\/guider.git\r\n$ cd guider\r\n$ guider.py  [Run without installing]\r\n<\/pre>\n<p>You can run\u00a0<code>guider.py<\/code>\u00a0without installing it. Alternatively, you can run the commands below to build and install it as shown.<\/p>\n<pre>$ make\r\n$ sudo make install \r\n<\/pre>\n<p>If you can use\u00a0<strong>PIP<\/strong>\u00a0in your system then install it using the following command.<\/p>\n<pre>$sudo pip install --pre guider\r\n<\/pre>\n<h3>How to Use Guider to Analyze Linux System Performance<\/h3>\n<p>By default, guider is supposed to set buffer size for its operations. However, if it fails to do that and shows an error once you invoke it, you can check your buffer size, with this command.<\/p>\n<pre>$ sudo cat \/sys\/kernel\/debug\/tracing\/buffer_size_kb\r\n<\/pre>\n<p>If the value is less than\u00a0<strong>40960<\/strong>, then set it to the required value as follows.<\/p>\n<pre>$ echo 40960 | sudo tee \/sys\/kernel\/debug\/tracing\/buffer_size_kb\r\n<\/pre>\n<div id=\"attachment_28354\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/01\/Set-Linux-Kernel-Buffer-Size.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-28354\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/01\/Set-Linux-Kernel-Buffer-Size.png\" sizes=\"auto, (max-width: 862px) 100vw, 862px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/01\/Set-Linux-Kernel-Buffer-Size.png 862w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/01\/Set-Linux-Kernel-Buffer-Size-768x120.png 768w\" alt=\"Set Linux Kernel Buffer Size\" width=\"862\" height=\"135\" aria-describedby=\"caption-attachment-28354\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-28354\" class=\"wp-caption-text\">Set Linux Kernel Buffer Size<\/p>\n<\/div>\n<p>You can invoke guider in thread, function, top, file and system modes using the following syntax.<\/p>\n<pre>$ guider [ mode | file ] [options]\r\n<\/pre>\n<p>As is the case with most command line based\u00a0<a href=\"https:\/\/www.tecmint.com\/command-line-tools-to-monitor-linux-performance\/\" target=\"_blank\" rel=\"noopener\">Linux system performance analysis tools<\/a>, you will need a wider screen to clearly view guider\u2019s output.<\/p>\n<h4>Perform CPU Usage Analysis in Thread Mode<\/h4>\n<p>The following command will start accurate tracing in thread mode (press\u00a0<code>[Ctrl+c]<\/code>\u00a0terminate the tracing process). Once you terminate the process, it will save data and start the analysis process, and there after show you the analysis report.<\/p>\n<pre>$ sudo guider record\t\r\n<\/pre>\n<div id=\"attachment_28355\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/01\/CPU-Tracing-Thread-Mode.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-28355\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/01\/CPU-Tracing-Thread-Mode.png\" sizes=\"auto, (max-width: 822px) 100vw, 822px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/01\/CPU-Tracing-Thread-Mode.png 822w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/01\/CPU-Tracing-Thread-Mode-768x517.png 768w\" alt=\"CPU Tracing in Thread Mode\" width=\"822\" height=\"553\" aria-describedby=\"caption-attachment-28355\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-28355\" class=\"wp-caption-text\">CPU Tracing in Thread Mode<\/p>\n<\/div>\n<p>The analysis report includes general system info, OS info, CPU info, memory info, disk info as well as thread info towards the end of the pager. Simply use the\u00a0<code>Up<\/code>\u00a0and\u00a0<code>Down<\/code>\u00a0arrows to scroll up and down the pager.<\/p>\n<div id=\"attachment_28359\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/01\/Linux-System-Information.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-28359\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/01\/Linux-System-Information.png\" sizes=\"auto, (max-width: 820px) 100vw, 820px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/01\/Linux-System-Information.png 820w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/01\/Linux-System-Information-768x887.png 768w\" alt=\"Linux System Information\" width=\"820\" height=\"947\" aria-describedby=\"caption-attachment-28359\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-28359\" class=\"wp-caption-text\">Linux System Information<\/p>\n<\/div>\n<h4>Perform Real Time Linux Monitoring in Top Mode<\/h4>\n<p>The following command will show resource usage of Linux processes in real-time.<\/p>\n<pre>$ sudo guider.py top \r\n<\/pre>\n<div id=\"attachment_28360\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/01\/Real-Time-Linux-Processes-Monitoring.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-28360\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/01\/Real-Time-Linux-Processes-Monitoring.png\" sizes=\"auto, (max-width: 947px) 100vw, 947px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/01\/Real-Time-Linux-Processes-Monitoring.png 947w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/01\/Real-Time-Linux-Processes-Monitoring-768x363.png 768w\" alt=\"Real Time Linux Processes Monitoring\" width=\"947\" height=\"447\" aria-describedby=\"caption-attachment-28360\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-28360\" class=\"wp-caption-text\">Real Time Linux Processes Monitoring<\/p>\n<\/div>\n<p>You can set an interval for showing output using the\u00a0<code>-i<\/code>\u00a0switch as shown.<\/p>\n<pre>$ sudo guider top -i 2\r\n<\/pre>\n<p>To monitor all information concerning resource usage, use the\u00a0<code>-a<\/code>\u00a0flag.<\/p>\n<pre>$ sudo guider top -a\r\n<\/pre>\n<h4>Analyze a Single Linux Process Using PID<\/h4>\n<p>First get the process ID using the\u00a0<strong>pidof<\/strong>\u00a0or\u00a0<a href=\"https:\/\/www.tecmint.com\/ps-command-examples-for-linux-process-monitoring\/\" target=\"_blank\" rel=\"noopener\">ps command<\/a>.<\/p>\n<pre>$ pidof apache2\r\nOR\r\n$ ps -e | grep apache2\r\n<\/pre>\n<p>Then analyze its resource usage using the following command, which outputs CPU cycle, instruction number, IPC, faults, cache miss, branch miss and so much more in real-time. The\u00a0<code>-g<\/code>\u00a0switch sets a filter which in this case is the process ID.<\/p>\n<pre>$ sudo guider top -eP -g 1913\r\n<\/pre>\n<div id=\"attachment_28361\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/01\/Monitor-Apache-Process-Usage.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-28361\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/01\/Monitor-Apache-Process-Usage.png\" sizes=\"auto, (max-width: 887px) 100vw, 887px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/01\/Monitor-Apache-Process-Usage.png 887w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/01\/Monitor-Apache-Process-Usage-768x282.png 768w\" alt=\"Monitor Apache Process Usage\" width=\"887\" height=\"326\" aria-describedby=\"caption-attachment-28361\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-28361\" class=\"wp-caption-text\">Monitor Apache Process Usage<\/p>\n<\/div>\n<h4>Save Guider Output to a File<\/h4>\n<p>You can as well save trace data or any output in a file for later analysis. The following command saves the trace data in a file called\u00a0<strong>guider.dat<\/strong>\u00a0(by default) in the current directory, you can specify a different location as well.<\/p>\n<pre>$ sudo guider -s .\r\n<\/pre>\n<p>To save any other output in a file called\u00a0<strong>guider.out<\/strong>\u00a0(by default) in the current directory.<\/p>\n<pre>$ sudo guider top -o .\r\n<\/pre>\n<p>Then you can inspect these files through the\u00a0<a href=\"https:\/\/www.tecmint.com\/13-basic-cat-command-examples-in-linux\/\" target=\"_blank\" rel=\"noopener\">cat command<\/a>.<\/p>\n<pre>$ cat guider.dat\r\n$ cat guider.out\r\n<\/pre>\n<p>We can not exhaust all the possible options here because the list of options is endless. You can see all options and more usage examples from the guider help page.<\/p>\n<pre>$ guider -h\r\n<\/pre>\n<p>Guider Github repository:\u00a0<a href=\"https:\/\/github.com\/iipeace\/guider\" target=\"_blank\" rel=\"nofollow noopener\">https:\/\/github.com\/iipeace\/guider<\/a><\/p>\n<h5>Conclusion<\/h5>\n<p><strong>Guider<\/strong>\u00a0is a great system-wide performance analysis tool for the future. It is suitable for Linux experts. Try out most of its features and share your thoughts with us via the feedback form below. If you have come across any similar tools, let us know as well.<\/p>\n<p><a href=\"https:\/\/www.tecmint.com\/guider-a-system-wide-linux-performance-analyzer\/\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Guider\u00a0is a free and opens source, powerful system-wide performance analysis tool written mostly in\u00a0Python\u00a0for Linux operating systems. It is designed to measure amount of system resource usage and to trace system behavior thus making it easy to analyze system performance issues effectively or allow for performance tunning. It shows you a great wealth of information &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/04\/06\/guider-a-system-wide-linux-performance-analyzer\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Guider \u2013 A System Wide Linux Performance Analyzer&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-13847","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/13847","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/comments?post=13847"}],"version-history":[{"count":1,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/13847\/revisions"}],"predecessor-version":[{"id":13848,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/13847\/revisions\/13848"}],"wp:attachment":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/media?parent=13847"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/categories?post=13847"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/tags?post=13847"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}