HP-UX System Administrator's Guide: Overview HP-UX 11i v3 (B3921-90011, September 2010)

NOTE: To get a snapshot of the total amount of swap space currently being used, use the
command:
# /usr/sbin/swapinfo -tam
Mb Mb Mb PCT START/ Mb
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 4096 0 4096 0% 0 - 1 /dev/vg00/lvol2
reserve - 257 -257
memory 1940 562 1378 29%
total 6036 819 5217 14% - 0 -
This number will vary over time, depending on the current mix of applications running, but if
the total percentage used is regularly high, roughly 90% or greater, then you probably need to
add more swap space.
Once you know or suspect that you will have to increase (or decrease) your swap space, you
should estimate your swap space requirements.
You can estimate the amount of swap space you need by adding the memory requirements of
the applications you expect to run (simultaneously) on your system to the amount of physical
memory you have.
Enabling Swap Space
When HP-UX is in the earliest stages of the boot sequence, the system begins by paging on only
a single device so that only one disk is required at boot time.
During the processing of the startup script /sbin/init.d/swap_start, calls to swapon
enable any additional paging areas, if any are defined in the file /etc/fstab.
Should you find the need for additional paging space while your system is running, you can
also run the swapon command to manually enable additional space. See the swapon(1M) and
fstab(4) manpages for details.
Disabling Swap Space
Sometimes, you can disable swap space. In order to be able to disable paging to swap areas:
your system must be running HP-UX 11i Version 3 September 2008 Update, or later
sufficient swap space must remain active (following the change) to continue to operate your
system
Use the swapoff command to disable paging to a specific swap area. For example:
/usr/sbin/swapoff /dev/vg00/lvol2
Guidelines for Setting Up Swap Areas
There are some guidelines to consider when configuring swap space on your system. Most of
these are focused on maximizing the performance of HP-UX.
Device Swap Guidelines
Use the following guidelines to configure the most commonly used type of swap space, device
swap:
Interleave device swap areas for better performance.
Two swap areas on different disks perform better than one swap area with the equivalent
amount of space. This allows interleaved swapping which means the swap areas are written
to concurrently, minimizing disk head movement, thus enhancing performance.
When using LVM, you should set up secondary swap areas within logical volumes that are
on different disks (physical volumes) using lvextend.
62 Major Components of HP-UX