DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Tuning memory resources

Viewing swapping and paging activity

The impact of swapping and paging out activity on disk activity can be seen with sar -w (or mpsar -w for SMP):

   23:59:44 swpin/s bswin/s swpot/s bswot/s pswch/s
   23:59:49    0.00     0.0    0.00     0.0     280
   23:59:54    0.00     0.0    0.00     0.0     244
   23:59:59    0.00     0.0    0.02     0.3     203
   

Average 0.00 0.0 0.01 0.1 242

The column of interest is bswot/s, the average number of pages swapped out per second during the sampling interval. The ratios of pages to transfer requests per second (bswin/s to swpin/s, and bswot/s to swpot/s) show how many pages could be moved between memory and disk per average disk transfer.

Swapping activity is also indicated by the size of the swap queue. The swap queue is a queue of runnable processes held in the swap area. Swapped-out processes are queued in an order determined by how long they have been swapped out. The process that has been swapped out for the longest period of time will be the first to be swapped in, as long as it is ready to run.

The values of swpq-sz and %swpocc displayed by sar -q (or mpsar -q for SMP) indicate the number of runnable processes on swap, and the percentage of time that the swap areas were occupied by runnable processes:

   23:59:44 runq-sz %runocc swpq-sz %swpocc
   23:59:49     1.7      98     1.5      36
   23:59:54     1.0      63     1.0      31
   23:59:59     1.0      58     1.0      49
   

Average 1.3 74 1.2 39

You can see paging activity using sar -p (or mpsar -p for SMP):
   23:59:44  vflt/s  pflt/s pgfil/s  rclm/s
   23:59:49    9.72    2.03    0.00    0.00
   23:59:54    0.37    0.18    0.00    0.00
   23:59:59    0.00    0.00    0.00    0.00
   

Average 3.88 0.84 0.00 0.00

vflt/s is the number of valid pages referenced per second that were not found in physical memory. A referenced page that was previously paged out to swap, or exists as a text or data page in the filesystem is loaded from disk.

pflt/s is the number of pages per second required by new processes for their data (both initialized and uninitialized) and stack. New processes created by the fork(S) system call do not acquire their own data and stack pages until they or their parent process attempts to write to them. This number also includes the number of illegal attempts to access memory per second.

pgfil/s is the number of page references satisfied by reading text and data pages from filesystems.

rclm/s is the number of pages per second that the page stealer and swapper daemons (vhand and sched) have reclaimed and added to the free list. This is an upper limit to the number of pages that are written to the swap area per second in the sampling interval (text and unchanged data are not written to swap as they can be read from the filesystem).

The important column is rclm/s which shows if your system is swapping or paging. To confirm this, look at the amount of free memory, freemem reported by sar -r (or mpsar -r for SMP). It is likely that vhand has been running if freemem has been keeping close to the value of GPGSHI.

Another indicator of swapping or paging activity is the cumulative CPU usage shown in the TIME column by the ps -l -p 0,2 command. (sched and vhand have PIDs 0 and 2 respectively.)


Next topic: Identifying memory-bound systems
Previous topic: Viewing swap space usage

© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003