{"id":79098,"date":"2026-11-17T02:03:44","date_gmt":"2026-11-17T02:03:44","guid":{"rendered":"http:\/\/bangla.sitestree.com\/?p=79098"},"modified":"2026-11-17T02:03:44","modified_gmt":"2026-11-17T02:03:44","slug":"linux-advanced-2-04-performance","status":"publish","type":"post","link":"http:\/\/bangla.sitestree.com\/?p=79098","title":{"rendered":"Linux Advanced 2 04 \u2014 Performance Triage with vmstat and PSI"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/bangla.sitestree.com\/?name=linux-course-index\">Linux course index<\/a> \u00b7 <a href=\"https:\/\/bangla.sitestree.com\/?cat=1993\">Linux Advanced 2 category<\/a> \u00b7 Lesson 4 of 7<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>AI disclosure<\/strong> \u2014 AI-generated content, posted as is. AI can make mistakes. This extension adds new material and links related posts from this site. The newly written explanations and examples may be freely reused. Linked source material retains its own terms.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Learning goal<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Use related signals to decide whether to investigate CPU, memory, disk I\/O, or an application bottleneck.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Concepts and setup<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The archive introduces free, vmstat, top, and process inspection. This lesson adds Pressure Stall Information (PSI), when the kernel exposes it. PSI reports when tasks are delayed by scarce CPU, memory, or I\/O. A resource can be busy without causing observable stalls, and a stalled request can involve more than one resource. Ignore the first vmstat row when comparing recent samples because it commonly summarizes data since boot. Compare telemetry to the time of the application symptom.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Collect a short read-only baseline<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>date -u '+%FT%TZ'\nuptime\nfree -h\nvmstat -w 1 4\nfor resource in cpu memory io; do\n  path=&quot;\/proc\/pressure\/$resource&quot;\n  if test -r &quot;$path&quot;; then printf '%s\\n' &quot;$resource&quot;; cat &quot;$path&quot;; fi\ndone<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Possible output<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>2026-11-16T20:00:00Z\n... load average: 0.12, 0.10, 0.08\n...\ncpu\nsome avg10=0.06 avg60=0.02 avg300=0.00 total=721540\nmemory\nsome avg10=0.00 avg60=0.00 avg300=0.00 total=2198\nfull avg10=0.00 avg60=0.00 avg300=0.00 total=661\nio\nsome avg10=0.00 avg60=0.00 avg300=0.00 total=55385<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The output is an abbreviated example. PSI percentages use rolling windows of roughly 10, 60, and 300 seconds. Missing files mean this interface is not available in that environment, not that pressure is zero.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Check who is consuming resources<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>ps -eo pid,comm,%cpu,%mem --sort=-%cpu | head -n 6\ndf -h &quot;$HOME&quot;\n# If iostat is installed:\niostat -xz 1 3<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Possible output<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>PID COMMAND       %CPU %MEM\n234 python3        9.8  1.6\n...\nFilesystem      Size Used Avail Use% Mounted on\n\/dev\/vda1        30G 5.1G   23G  19% \/\n...<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">ps %CPU is normally averaged over a process lifetime rather than an instantaneous sample. df answers a capacity question, not an I\/O latency question. If iostat is available, inspect interval data and compare it with the time and symptoms.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Questions only<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Quick-check questions<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n\n<li>Why is free memory alone a poor measure of memory trouble?<\/li>\n\n\n<li>What does a sustained increase in I\/O pressure tell you?<\/li>\n\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">Assessment questions<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n\n<li>vmstat shows a sustained runnable queue and CPU PSI is elevated while memory and I\/O pressure are low. Which resource comes first?<\/li>\n\n\n<li>How would you distinguish a full filesystem from slow disk requests?<\/li>\n\n\n<li>What would make you suspect the application rather than visible host resource pressure?<\/li>\n\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">Questions and answers<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Quick-check answers<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n\n<li><strong>Why is free memory alone a poor measure of memory trouble?<\/strong><br><strong>Answer<\/strong> \u2014 Linux uses memory for cache that can often be reclaimed. Consider available memory, swap activity, pressure, and the workload.<\/li>\n\n\n<li><strong>What does a sustained increase in I\/O pressure tell you?<\/strong><br><strong>Answer<\/strong> \u2014 At least some work is stalling for I\/O. It does not identify which device or request caused the stall.<\/li>\n\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">Assessment answer key<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n\n<li><strong>vmstat shows a sustained runnable queue and CPU PSI is elevated while memory and I\/O pressure are low. Which resource comes first?<\/strong><br><strong>Answer<\/strong> \u2014 Investigate CPU scheduling and top CPU consumers first, then correlate with application latency.<\/li>\n\n\n<li><strong>How would you distinguish a full filesystem from slow disk requests?<\/strong><br><strong>Answer<\/strong> \u2014 Use df for capacity and interval I\/O telemetry plus PSI for activity, queue and waiting symptoms.<\/li>\n\n\n<li><strong>What would make you suspect the application rather than visible host resource pressure?<\/strong><br><strong>Answer<\/strong> \u2014 A reproducible slowdown with no corresponding resource pressure makes application logs, dependencies, and request timing worth examining.<\/li>\n\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">Related source articles on this site<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n\n<li><a href=\"https:\/\/bangla.sitestree.com\/?p=76443\">Linux: Disk Space, Memory Space, Running Processes<\/a><\/li>\n\n\n<li><a href=\"https:\/\/bangla.sitestree.com\/?p=76460\">Monitor Process in Linux<\/a><\/li>\n\n\n<li><a href=\"https:\/\/bangla.sitestree.com\/?p=9657\">\u0987\u0989\u09a8\u09bf\u0995\u09cd\u09b8\u0983 \u09b8\u09bf\u09b8\u09cd\u099f\u09c7\u09ae \u09aa\u09be\u09b0\u09ab\u09b0\u09cd\u09ae\u09c7\u09a8\u09cd\u09b8 (Unix \u2013 System Performance)<\/a><\/li>\n\n\n<li><a href=\"https:\/\/bangla.sitestree.com\/?p=9949\">\u0987\u0989\u09a8\u09bf\u0995\u09cd\u09b8\u0983 \u09b8\u09bf\u09b8\u09cd\u099f\u09c7\u09ae \u09b2\u0997\u09bf\u0982 (Unix \u2013 System Logging)<\/a><\/li>\n\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Technical references<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n\n<li><a href=\"https:\/\/docs.kernel.org\/accounting\/psi.html\">Linux kernel guide to PSI<\/a><\/li>\n\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Continue the course<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Previous lesson 03 \u2014 Repeatable Configuration with Ansible. Next lesson 05 \u2014 Kernel Modules and Resource Limits.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/bangla.sitestree.com\/?name=linux-course-index\">Linux course index<\/a> \u00b7 <a href=\"https:\/\/bangla.sitestree.com\/?cat=1993\">Linux Advanced 2 category<\/a> \u00b7 Lesson 4 of 7<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Use related signals to decide whether to investigate CPU, memory, disk I\/O, or an application bottleneck.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":true,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_hide_featured_image":false,"_jetpack_featured_image_duplicate_dismissed":0,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[1993],"tags":[],"class_list":["post-79098","post","type-post","status-publish","format-standard","hentry","category-linux-advanced-2","item-wrap"],"jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":79102,"url":"http:\/\/bangla.sitestree.com\/?p=79102","url_meta":{"origin":79098,"position":0},"title":"Linux Administration Course \u2014 Start Here and Lesson Index","author":"Sayed","date":"November 17, 2026","format":false,"excerpt":"A 33-lesson Linux course from shell fundamentals to server administration, performance, and a recovery capstone.","rel":"","context":"In &quot;Linux Basics&quot;","block_context":{"text":"Linux Basics","link":"http:\/\/bangla.sitestree.com\/?cat=1990"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":79099,"url":"http:\/\/bangla.sitestree.com\/?p=79099","url_meta":{"origin":79098,"position":1},"title":"Linux Advanced 2 05 \u2014 Kernel Modules and Resource Limits","author":"Sayed","date":"November 17, 2026","format":false,"excerpt":"Read kernel module information and identify the current process\u2019s resource-control group without changing the kernel.","rel":"","context":"In &quot;Linux Advanced 2&quot;","block_context":{"text":"Linux Advanced 2","link":"http:\/\/bangla.sitestree.com\/?cat=1993"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":76443,"url":"http:\/\/bangla.sitestree.com\/?p=76443","url_meta":{"origin":79098,"position":2},"title":"Linux: Disk Space, Memory Space, Running Processes","author":"Sayed","date":"December 8, 2024","format":false,"excerpt":"df command \u2013 Shows the amount of disk space used and available on Linux file systems. du command \u2013 Display the amount of disk space used by the specified files and for each subdirectory. free command top or htop command vmstat command dmidecode command \/proc\/meminfo file Linux commands show all\u2026","rel":"","context":"In &quot;Root&quot;","block_context":{"text":"Root","link":"http:\/\/bangla.sitestree.com\/?cat=1"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":79097,"url":"http:\/\/bangla.sitestree.com\/?p=79097","url_meta":{"origin":79098,"position":3},"title":"Linux Advanced 2 03 \u2014 Repeatable Configuration with Ansible","author":"Sayed","date":"November 17, 2026","format":false,"excerpt":"Convert a small configuration task into an Ansible playbook and demonstrate idempotence.","rel":"","context":"In &quot;Linux Advanced 2&quot;","block_context":{"text":"Linux Advanced 2","link":"http:\/\/bangla.sitestree.com\/?cat=1993"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":79086,"url":"http:\/\/bangla.sitestree.com\/?p=79086","url_meta":{"origin":79098,"position":4},"title":"Linux Advanced 01 \u2014 LVM and Controlled Filesystem Growth","author":"Sayed","date":"November 17, 2026","format":false,"excerpt":"Create and expand an isolated LVM stack without touching the system disk.","rel":"","context":"In &quot;Linux Advanced&quot;","block_context":{"text":"Linux Advanced","link":"http:\/\/bangla.sitestree.com\/?cat=1992"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":79095,"url":"http:\/\/bangla.sitestree.com\/?p=79095","url_meta":{"origin":79098,"position":5},"title":"Linux Advanced 2 01 \u2014 Hardening a systemd Service","author":"Sayed","date":"November 17, 2026","format":false,"excerpt":"Run a small systemd service with a dedicated dynamic identity and a narrow writable directory.","rel":"","context":"In &quot;Linux Advanced 2&quot;","block_context":{"text":"Linux Advanced 2","link":"http:\/\/bangla.sitestree.com\/?cat=1993"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_featured_media_url":"","_links":{"self":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/79098","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=79098"}],"version-history":[{"count":0,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/79098\/revisions"}],"wp:attachment":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=79098"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=79098"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=79098"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}