{"id":10025,"date":"2018-04-25T04:37:32","date_gmt":"2018-04-25T02:37:32","guid":{"rendered":"http:\/\/blog.wenzlaff.de\/?p=10025"},"modified":"2021-11-22T17:14:10","modified_gmt":"2021-11-22T16:14:10","slug":"monitoring-wie-laufen-linux-performance-messungen-mit-vmstat-auf-dem-raspberry-pi-es-muss-ja-nicht-immer-top-sein","status":"publish","type":"post","link":"http:\/\/blog.wenzlaff.de\/?p=10025","title":{"rendered":"Monitoring: Wie laufen Linux Performance Messungen mit vmstat auf dem Raspberry Pi? Es muss ja nicht immer top sein!"},"content":{"rendered":"<p>Mit <a href=\"https:\/\/wiki.ubuntuusers.de\/vmstat\/\" rel=\"noopener\" target=\"_blank\">vmstat<\/a> (virtual memory statistics) k\u00f6nnen leicht folgende Werte fast in Echtzeit angzeigt werden:<br \/>\nAnzeige der Prozesse, Speicher, Paging, Block IO und CPU Aktivit\u00e4t &#8230;<\/p>\n<p>Hier die Anleitung, die mit <strong>vmstat -h<\/strong> angezeigt werden kann:<\/p>\n<pre class=\"lang:default decode:true \" >vmstat -h\r\n\r\nUsage:\r\n vmstat [options] [delay [count]]\r\n\r\nOptions:\r\n -a, --active           active\/inactive memory\r\n -f, --forks            number of forks since boot\r\n -m, --slabs            slabinfo\r\n -n, --one-header       do not redisplay header\r\n -s, --stats            event counter statistics\r\n -d, --disk             disk statistics\r\n -D, --disk-sum         summarize disk statistics\r\n -p, --partition &lt;dev&gt;  partition specific statistics\r\n -S, --unit &lt;char&gt;      define display unit\r\n -w, --wide             wide output\r\n -t, --timestamp        show timestamp\r\n\r\n -h, --help     display this help and exit\r\n -V, --version  output version information and exit\r\n\r\nFor more details see vmstat(8).<\/pre>\n<p><!--more--><\/p>\n<p>Weitere Infos gibt <strong>man vmstat<\/strong> oder die <a href=\"https:\/\/wiki.ubuntuusers.de\/vmstat\/\" rel=\"noopener\" target=\"_blank\">Seite<\/a><\/p>\n<pre class=\"lang:default decode:true \" >NAME\r\n       vmstat - Report virtual memory statistics\r\n\r\nSYNOPSIS\r\n       vmstat [options] [delay [count]]\r\n\r\nDESCRIPTION\r\n       vmstat  reports  information  about  processes,  memory, paging, block IO, traps, disks and cpu\r\n       activity.\r\n\r\n       The first report produced gives averages since the last reboot.  Additional reports give infor\u2010\r\n       mation  on a sampling period of length delay.  The process and memory reports are instantaneous\r\n       in either case.\r\n\r\nOPTIONS\r\n       delay  The delay between updates in seconds.  If no delay is  specified,  only  one  report  is\r\n              printed with the average values since boot.\r\n\r\n       count  Number of updates.  In absence of count, when delay is defined, default is infinite.\r\n\r\n       -a, --active\r\n              Display active and  inactive memory, given a 2.5.41 kernel or better.\r\n\r\n       -f, --forks\r\n              The  -f  switch displays the number of forks since boot.  This includes the fork, vfork,\r\n              and clone system calls, and is equivalent to the total number of  tasks  created.   Each\r\n              process  is  represented  by one or more tasks, depending on thread usage.  This display\r\n              does not repeat.\r\n\r\n       -m, --slabs\r\n              Displays slabinfo.\r\n\r\n       -n, --one-header\r\n              Display the header only once rather than periodically.\r\n\r\n       -s, --stats\r\n              Displays a table of various event counters and memory statistics.  This display does not\r\n              repeat.\r\n      -d, --disk\r\n              Report disk statistics (2.5.70 or above required).\r\n\r\n       -D, --disk-sum\r\n              Report some summary statistics about disk activity.\r\n\r\n       -p, --partition device\r\n              Detailed statistics about partition (2.5.70 or above required).\r\n\r\n       -S, --unit character\r\n              Switches  outputs  between  1000 (k), 1024 (K), 1000000 (m), or 1048576 (M) bytes.  Note\r\n              this does not change the swap (si\/so) or block (bi\/bo) fields.\r\n\r\n       -t, --timestamp\r\n              Append timestamp to each line\r\n\r\n       -w, --wide\r\n              Wide output mode (useful for systems with higher amount of  memory,  where  the  default\r\n              output mode suffers from unwanted column breakage).  The output is wider than 80 charac\u2010\r\n              ters per line.\r\n\r\n       -V, --version\r\n              Display version information and exit.\r\n\r\n       -h, --help\r\n              Display help and exit.\r\n\r\nFIELD DESCRIPTION FOR VM MODE\r\n   Procs\r\n       r: The number of runnable processes (running or waiting for run time).\r\n       b: The number of processes in uninterruptible sleep.\r\n\r\n   Memory\r\n       swpd: the amount of virtual memory used.\r\n       free: the amount of idle memory.\r\n       buff: the amount of memory used as buffers.\r\n       cache: the amount of memory used as cache.\r\n       inact: the amount of inactive memory.  (-a option)\r\n       active: the amount of active memory.  (-a option)\r\n  Swap\r\n       si: Amount of memory swapped in from disk (\/s).\r\n       so: Amount of memory swapped to disk (\/s).\r\n\r\n   IO\r\n       bi: Blocks received from a block device (blocks\/s).\r\n       bo: Blocks sent to a block device (blocks\/s).\r\n\r\n   System\r\n       in: The number of interrupts per second, including the clock.\r\n       cs: The number of context switches per second.\r\n\r\n   CPU\r\n       These are percentages of total CPU time.\r\n       us: Time spent running non-kernel code.  (user time, including nice time)\r\n       sy: Time spent running kernel code.  (system time)\r\n       id: Time spent idle.  Prior to Linux 2.5.41, this includes IO-wait time.\r\n       wa: Time spent waiting for IO.  Prior to Linux 2.5.41, included in idle.\r\n       st: Time stolen from a virtual machine.  Prior to Linux 2.6.11, unknown.\r\n\r\nFIELD DESCRIPTION FOR DISK MODE\r\n   Reads\r\n       total: Total reads completed successfully\r\n       merged: grouped reads (resulting in one I\/O)\r\n       sectors: Sectors read successfully\r\n       ms: milliseconds spent reading\r\n\r\n   Writes\r\n       total: Total writes completed successfully\r\n       merged: grouped writes (resulting in one I\/O)\r\n       sectors: Sectors written successfully\r\n       ms: milliseconds spent writing\r\n\r\n   IO\r\n       cur: I\/O in progress\r\n       s: seconds spent for I\/O\r\nFIELD DESCRIPTION FOR DISK PARTITION MODE\r\n       reads: Total number of reads issued to this partition\r\n       read sectors: Total read sectors for partition\r\n       writes : Total number of writes issued to this partition\r\n       requested writes: Total number of write requests made for partition\r\n\r\nFIELD DESCRIPTION FOR SLAB MODE\r\n       cache: Cache name\r\n       num: Number of currently active objects\r\n       total: Total number of available objects\r\n       size: Size of each object\r\n       pages: Number of pages with at least one active object\r\n\r\nNOTES\r\n       vmstat does not require special permissions.\r\n\r\n       These reports are intended to help identify system bottlenecks.  Linux vmstat  does  not  count\r\n       itself as a running process.\r\n\r\n       All  linux  blocks  are currently 1024 bytes.  Old kernels may report blocks as 512 bytes, 2048\r\n       bytes, or 4096 bytes.\r\n\r\n       Since procps 3.1.9, vmstat lets you choose units (k, K, m, M).  Default is K  (1024  bytes)  in\r\n       the default mode.\r\n\r\n       vmstat uses slabinfo 1.1\r\n\r\nFILES\r\n       \/proc\/meminfo\r\n       \/proc\/stat\r\n       \/proc\/*\/stat\r\n...\r\n<\/pre>\n<p>Fangen wir mit einer Messung alle 2 Sekunden an, und beenden wir das Programm automatisch nach 8 Messungen, Aufruf:<br \/>\n<strong>vmstat 2 8<\/strong><br \/>\nHier das Ergebnis auf einen Rasberry Pi Zero W:<\/p>\n<pre class=\"lang:default decode:true \" >procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu-----\r\n r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa st\r\n 0  0   1536  33268 134640 236680    0    0     3     1   29   41  0  0 99  0  0\r\n 0  0   1536  33268 134640 236680    0    0     0     0   70   74  0  0 100  0  0\r\n 0  0   1536  33268 134640 236680    0    0     0     0   45   52  0  0 100  0  0\r\n 0  0   1536  33268 134644 236680    0    0     0     2   36   48  0  1 99  1  0\r\n 0  0   1536  33268 134644 236680    0    0     0     0   33   40  0  0 100  0  0\r\n 0  0   1536  33268 134644 236680    0    0     0    16  129  126  3  1 96  0  0\r\n 0  0   1536  33268 134644 236680    0    0     0     0   51   64  0  1 99  0  0\r\n 0  0   1536  33268 134644 236680    0    0     0     0   99   86  1  1 99  0  0<\/pre>\n<p>Und mit etwas Last beim Linken von Gnuradio:<\/p>\n<pre class=\"lang:default decode:true \" >procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu-----\r\n r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa st\r\n 1  0  37120  31156   5764  69312    0    0    14    18  248  119 13  1 86  0  0\r\n 1  0  37120 331608   5772  69772    0    0   174   106 4308  159 88 11  0  0  0\r\n 1  0  37120 326400   6048  74216    2    0  2554     0 4388  746 69 15  0 16  0\r\n 1  0  37120 320944   6056  74216    0    0     0    60 4225   68 100  0  0  0  0\r\n 1  0  37120 316108   6056  74216    0    0     0     0 4222   47 98  3  0  0  0\r\n 1  0  37120 311272   6056  74216    0    0     0     0 4208   37 99  2  0  0  0\r\n 2  0  37120 306932   6056  74224    0    0     0     4 4083   61 99  2  0  0  0\r\n 1  0  37120 305272   7600  79836    2    0  3578     0 4220  847 59 23  0 19  0<\/pre>\n<p><strong>vmstat -D<\/strong><\/p>\n<pre class=\"lang:default decode:true \" > 25 disks\r\n            2 partitions\r\n        25537 total reads\r\n         9365 merged reads\r\n       496408 read sectors\r\n        33220 milli reading\r\n         6656 writes\r\n         5774 merged writes\r\n       105819 written sectors\r\n       287330 milli writing\r\n            0 inprogress IO\r\n           92 milli spent IO<\/pre>\n<p><strong>vmstat -s<\/strong><\/p>\n<pre class=\"lang:default decode:true \" >443900 K total memory\r\n        39344 K used memory\r\n       209896 K active memory\r\n        71976 K inactive memory\r\n        32028 K free memory\r\n       134652 K buffer memory\r\n       237876 K swap cache\r\n       102396 K total swap\r\n         1536 K used swap\r\n       100860 K free swap\r\n        21169 non-nice user cpu ticks\r\n          920 nice user cpu ticks\r\n        23434 system cpu ticks\r\n      9814375 idle cpu ticks\r\n         3614 IO-wait cpu ticks\r\n            0 IRQ cpu ticks\r\n         2530 softirq cpu ticks\r\n            0 stolen cpu ticks\r\n       248268 pages paged in\r\n        52909 pages paged out\r\n           26 pages swapped in\r\n          340 pages swapped out\r\n      2917180 interrupts\r\n      4098152 CPU context switches\r\n   1524489822 boot time\r\n         8072 forks<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Mit vmstat (virtual memory statistics) k\u00f6nnen leicht folgende Werte fast in Echtzeit angzeigt werden: Anzeige der Prozesse, Speicher, Paging, Block IO und CPU Aktivit\u00e4t &#8230; Hier die Anleitung, die mit vmstat -h angezeigt werden kann: vmstat -h Usage: vmstat [options] [delay [count]] Options: -a, &#8211;active active\/inactive memory -f, &#8211;forks number of forks since boot -m, &hellip; <\/p>\n<p class=\"link-more\"><a href=\"http:\/\/blog.wenzlaff.de\/?p=10025\" class=\"more-link\"><span class=\"screen-reader-text\">\u201eMonitoring: Wie laufen Linux Performance Messungen mit vmstat auf dem Raspberry Pi? Es muss ja nicht immer top sein!\u201c <\/span>weiterlesen<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[220,808,1023,2752,2713],"tags":[3212,1747,3038,692],"class_list":["post-10025","post","type-post","status-publish","format-standard","hentry","category-anleitung","category-linux-2","category-raspberry-pi","category-raspberry-pi-zero-w","category-statistik","tag-cpu","tag-monitoring","tag-performance","tag-speicher"],"_links":{"self":[{"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=\/wp\/v2\/posts\/10025","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=10025"}],"version-history":[{"count":0,"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=\/wp\/v2\/posts\/10025\/revisions"}],"wp:attachment":[{"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10025"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=10025"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=10025"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}