A opção -W
parece ser a opção original enquanto a opção -B
aparece mais tarde. Há notas na man page que parecem indicar isso também. A opção -B
tem estatísticas mais recentes que foram expostas em uma versão posterior do kernel do Linux (postagem 2.5).
-W
usage
-W Report swapping statistics. The following values are displayed:
pswpin/s Total number of swap pages the system brought in per second. pswpout/s Total number of swap pages the system brought out per second.
-B
usage
-B Report paging statistics. Some of the metrics below are available only with post 2.5 kernels. The following values are displayed:
pgpgin/s Total number of kilobytes the system paged in from disk per second. Note: With old kernels (2.2.x) this value is a number of blocks per second (and not kilobytes). pgpgout/s Total number of kilobytes the system paged out to disk per second. Note: With old kernels (2.2.x) this value is a number of blocks per second (and not kilobytes). fault/s Number of page faults (major + minor) made by the system per second. This is not a count of page faults that generate I/O, because some page faults can be resolved without I/O. majflt/s Number of major faults the system has made per second, those which have required loading a memory page from disk. pgfree/s Number of pages placed on the free list by the system per second. pgscank/s Number of pages scanned by the kswapd daemon per second. pgscand/s Number of pages scanned directly per second. pgsteal/s Number of pages the system has reclaimed from cache (pagecache and swapcache) per second to satisfy its memory demands. %vmeff Calculated as pgsteal / pgscan, this is a metric of the efficiency of page reclaim. If it is near 100% then almost every page coming off the tail of the inactive list is being reaped. If it gets too low (e.g. less than 30%) then the virtual memory is having some difficulty. This field is displayed as zero if no pages have been scanned during the interval of time.
Exemplos
Se você observar a saída dos switches -B
e -W
que podem ajudar a esclarecer as diferenças.
-W
$ sar -W
02:50:01 PM pswpin/s pswpout/s
03:00:01 PM 0.57 1.71
03:10:01 PM 0.31 0.02
03:20:01 PM 0.80 1.25
03:30:01 PM 0.41 0.68
03:40:01 PM 0.57 1.02
03:50:01 PM 0.88 0.00
-B
$ sar -B
02:50:01 PM pgpgin/s pgpgout/s fault/s majflt/s pgfree/s pgscank/s pgscand/s pgsteal/s %vmeff
03:00:01 PM 96.10 615.25 6113.00 0.44 7612.77 105.80 0.00 96.48 91.19
03:10:01 PM 14.91 562.47 5250.07 0.17 7029.09 26.63 0.00 23.72 89.08
03:20:01 PM 16.95 620.39 7265.82 0.26 9115.73 92.36 0.11 83.01 89.77
03:30:01 PM 28.84 566.17 8768.76 0.21 10750.77 63.20 0.21 58.65 92.49
03:40:01 PM 16.05 641.84 10343.84 0.31 12473.88 45.40 0.11 41.01 90.11
03:50:01 PM 18.20 647.99 10272.98 0.25 12187.26 0.00 0.00 0.00 0.00
As diferenças são que -W
dados é em relação a quantas páginas foram trocadas em & em um segundo, em comparação com a opção -B
, que mostra a quantidade agregada de dados (em kilobytes) que foram paginados em / out em um segundo.