Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

What is the difference between the output from sar -W and sar -B they seem to be similar but the man pages only confuse me further on this matter any who clarify this for me ?

share|improve this question
The answer shows up in the man pages as the initial answer shows in the man page extract. Exactly what are you confused about? – mdpc Jun 10 '13 at 18:42
up vote 1 down vote accepted

The -W switch looks to be the original switch while the -B switch came later on. There are notes in the man page which seem to indicate this as well. The -B switch has newer statistics that were exposed in a later version of the Linux kernel (post 2.5).

-W usage

-W Report swapping statistics. The following values are displayed:

          Total number of swap pages the system brought in per second.
          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:

          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).

          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).

          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.

          Number of major faults the system has made per second, those which have required loading a memory page from

          Number of pages placed on the free list by the system per second.

          Number of pages scanned by the kswapd daemon per second.

          Number of pages scanned directly per second.

          Number of pages the system has reclaimed from cache (pagecache and swapcache) per  second  to  satisfy  its
          memory demands.

          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.


If you look at the output from the -B and -W switches that might help shed light on there differences.


$ 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


$ 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

The differences being that the -W data is with respect to how many pages were swapped in & out in a second, vs. the -B switch which shows the aggregate amount of data (in kilobytes) that was paged in/out in a second.

share|improve this answer
Hmmm...if the user says he is confused by the man page, will he not be confused with simply an extract of the man page for sar??? – mdpc Jun 10 '13 at 18:41
Well let's see 8-). – slm Jun 10 '13 at 18:52
unfortunately that does really clarify it for me.....any other takers who might be able to shed light on the difference between the two ...??? – user1380599 Jun 10 '13 at 20:34
@user1380599 - See my updates and let me know if you need more details. – slm Jun 10 '13 at 21:28
Thanks for your response that did the trick all clear now ;-) – user1380599 Jul 2 '13 at 15:38

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.