cancel
Showing results for 
Search instead for 
Did you mean: 

swap

SOLVED
Go to solution
A.G.M. Velthof
Valued Contributor

swap

Hello to all,

 

can anyone tell me why swap for hpux has to be contiguous?

Is it performance?

 

Regards, Alfons Celthof

9 REPLIES
Pete Randall
Outstanding Contributor

Re: swap

In very general, non-technical terms, when the system boots, it needs to be able to locate things in /stand, /, and swap.  However, the system at that point has no capability to utilize advanced file system concepts and must rely on things being loaded contiguously in order to locate them.


Pete
A.G.M. Velthof
Valued Contributor

Re: swap

does that only count for the first swap device lvol2?

 

What can happen if it is not contiguous?

 

Alfons

James R. Ferguson
Acclaimed Contributor

Re: swap


A.G.M. Velthof wrote:

does that only count for the first swap device lvol2?

 

What can happen if it is not contiguous?

 


All device swap must be built as contiguous.   "Primary" device swap, by definition, is 'vg00/lvol2'.  "Secondary" swap spaces can be other logical volumes on any volume group you choose as long as they too are allocated with contiguous extents.

 

The distinction of "primary" versus "secondary" in terms of performance (or the lack of) is meaningless.  Primary swap must be present at boot time and is never declared in '/etc/fstab'.  Secondary swap must be declared as such in '/etc/fstab' in order to be activated.

 

Secondary device swap can be allocated on vg00 or any other volume group you choose.  The swap priority you assign to each device controls whether interleaving I/O will occur or not as well as which device will be used in preference to another.  A good friend was fond of saying that worrying about swap I/O performance was worrying about "swapping deck chairs on the Titanic".

 

You need enough swap to handle edge case loads and to handle process swap reservation when a process is first born.  That is, every process must be able to "reserve" some swap space should it ever need it.  A failure to be able to do this will terminate the process with out-of-memory errors.

 

You never want to do more than reserve your swap.  If 'vmstat' shows page-outs in double digits you are beginning to swap heavily and performance is degraded.

 

As for what happens if a device swap isn't configured as contiguous, I expect that it will simply not activate and thus not be available.

 

Regards!

 

...JRF...

A.G.M. Velthof
Valued Contributor

Re: swap

Thanks for the answers.

 

I've seen on most of our SAP servers the swap space is not contiguous (except the lvol2), and they have

the swap available.

I'm trying to investigate whether we should  change it. (recreate the swap)

 

Alfons

 

Pete Randall
Outstanding Contributor

Re: swap

Not contiguous?  I don't think that's useable/possible.  Swap needs to be contiguous within each swap space.  You can have several swap spaces and they do not have to be contiguous to each other, as /stand, /, and swap do, but the logical volume containing the swap space has to be one continuous logical volume.  Take a look at the PE layout in a lvdisplay output of one of your suspect swap areas to see if the PEs aren't, in fact, consecutive and therefore contiguous.


Pete
James R. Ferguson
Acclaimed Contributor

Re: swap


A.G.M. Velthof wrote:

I've seen on most of our SAP servers the swap space is not contiguous (except the lvol2), and they have

the swap available.

I'm trying to investigate whether we should  change it. (recreate the swap)



A bit more digging and I have to retract my statement that secondary device swap must be contiguous.  The TKB as well as your empirical evidence prove that it doesn't need to be.  What makes sense for secondary swap is that LVM handles the mapping of the disk space, whereas with primary device swap, more primitive assumptions must prevail.

 

I don't see any need to change your configuration since it is working for you.

 

Regards!

 

...JRF...

Pete Randall
Outstanding Contributor
Solution

Re: swap

I guess that means I'm retracting, too!  Thanks once again for setting me straight, Jim.


Pete
A.G.M. Velthof
Valued Contributor

Re: swap

thanks for the solution, guess it saves me some work.........

Matti_Kurkela
Honored Contributor

Re: swap

My guess is that the requirement actually refers to the dump space. By standard HP-UX installation defaults, this is the same as primary swap.

 

The dump space is used by the system firmware to create a crashdump if the OS crashes or is intentionally TOCed. But the firmware is most likely too simple to have full support for LVM/VxVM, so the dump space location is configured to the firmware as "on this disk, starting from this block, at most this many blocks." This kind of simplified definition only works if the dump space is contiguous.

 

On PA-RISC hardware, the bootloader also requires the first three LVs to be /stand (which must be HFS), primary swap, and root, contiguous and in this order, because the PA-RISC bootloader must fit into small space and thus is too simple to really understand  LVM or VxVM. If the first three LVs are always contiguous and in the specified order, the bootloader only needs to be able to find out the total length of the /stand filesystem and the primary swap space: the root filesystem can then be found by simply looking past the end of the primary swap.

 

On Itanium hardware, the EFI bootloader is much more feature-rich and probably allows these restrictions to eventually be removed, should the HP-UX development team so choose.

MK