SUMMARY: Swap Space & utilization info

From: <NSYSTEM_at_beau.nb.rockwell.com>
Date: Thu, 2 Mar 1995 13:49:38 -0800 (PST)

SUMMARY: Utilization swap space info

I want to thank everyone who responded to my swap space
problem. This is the explaination that I got from
DR. Blinn in which closely explained why our configuration
failed that resulted in the swap space below 10%.

Below is the explaination.


Date: Tue, 28 Feb 95 09:05:18 -0500
From: "Dr. Tom Blinn, 603-881-0646" <tpb_at_zk3.dec.com>
X-Mts: smtp

> 1. What does "Reserved space" mean?

You probably have a /sbin/swapdefault symbolic link that points to your
primary swap partition. In this case, the virtual memory manager will use
"eager" allocation of swap space. This means that whenever a process has a
page mapped that isn't already backed by space in the file system (vm backs
pages from demand-paged executables, memory mapped files, etc. with source
pages in the file system instead of using swap space) a page in swap space
is allocated for it. These are the "reserved" pages. If you're using the
"lazy" allocation method (no /sbin/swapdefault symbolic link) then you'll
see the "reserved" space equal to the sum of the "in-use" space.

The "in-use" pages (reported on a per swap partition basis) are the pages
that actually have stuff written into them, that is, that represent valid
pages that aren't presently in memory. The sum of the "in-use" pages at any
given instant is the real use of backing store.

> 2. How can I detect swap space below 10% free by interpreting the
> displayed info?

It depends on whether you're using "eager" or "lazy" allocation. But either
way, it's when the "Available space" drops below 10% of the total space that
is "Allocated" for swap. So look at the percentage on the "Available space"
line:
 
Total swap allocation:
    Allocated space: 32704 pages (255MB)
    Reserved space: 8464 pages ( 25%)
    Available space: 24240 pages ( 74%)

> My configuration is rz2b, rz3b, rz3g, and rz21g as allocated
> swap space; rz2b is the primary swap space. I am writing a
> script to monitor the swap space, and I want to be able to
> calculate the "In-use space" and "Free space".

Swap partition /dev/rz0b:
    Allocated space: 16384 pages (128MB)
    In-use space: 2399 pages ( 14%)
    Free space: 13985 pages ( 85%)

Swap partition /dev/rz2b:
    Allocated space: 16320 pages (127MB)
    In-use space: 2437 pages ( 14%)
    Free space: 13883 pages ( 85%)

On each partition, the "Allocated space" will be the sum of the "In-use
space" and the "Free space" but because you're using "eager" allocation (you
have a primary swap partition), the "Reserved space" will (almost) always be
larger than the sum of the "In-use space" and the "Available space" will be
(almost always) less than the sum of the "Free space" across partitions.

You could use an awk script to sum the various values across partitions. It
is probably the easiest way to do it.

> My main concern is how are the 4 partitions being used to page
> and swap; I do notice that the primary partition is not used
> up to 100% before it goes to the next partition.

That is by design. When there are multiple partitions, the vm allocation is
done more or less "round robin" among the partitions that have free space.
This is an attempt to spread the I/O workload among partitions, which should
be on different devices. (I notice you say you have two partitions on rz3
used for swapping. This may not be a winning approach. When pages need to
be written to or read from both of those partitions, the heads need to move
long distances on the disk surface. You probably should combine the two rz3
swap partitions into a single partition, and if practical, locate it near
the middle of the disk using disklabel if you're using the disk for other
stuff as well [depending, of course, on the access patterns for the other
stuff on the same disk].)

Hope this brief overview is helpful. As far as I know, there isn't any kind
of documentation on this in the user manuals. There may be a white paper or
some slides that have been used at DECUS and other places.

Tom
 
 Dr. Thomas P. Blinn, UNIX Software Group, Digital Equipment Corporation
  110 Spit Brook Road, MS ZKO3-2/U20 Nashua, New Hampshire 03062-2698
   Technology Partnership Engineering Phone: (603) 881-0646
    Internet: tpb_at_zk3.dec.com Digital's Easynet: alpha::tpb

  Worry kills more people than work because more people worry than work.

     My favorite palindrome is: Satan, oscillate my metallic sonatas.
                                         -- Phil Agre, pagre_at_ucsd.edu

  Opinions expressed herein are my own, and do not necessarily represent
  those of my employer or anyone else, living or dead, real or imagined.
 
Received on Thu Mar 02 1995 - 16:51:17 NZDT

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:45 NZDT