1837394 Members
2907 Online
110116 Solutions
New Discussion

Re: Secondary SWAP

 
SOLVED
Go to solution
Kenneth_18
Frequent Advisor

Secondary SWAP

Hi,

I need to create a secondary swap space on lvol3 and a primary swap space on lvol2 during initial installation from the cd. Is the secondary swap creation option available for an l2000 server in the advance menu of the installtion?

I tried to create it on an old D370 but I'm unable to find the option to create a secondary swap in the advance installtion menu.

Is the secondary swap creation option h/w dependent.

If not, could you please enumerate the steps necessary to create the secondary swap space during an initial os install from the cd's.

Thanks in advance.
9 REPLIES 9
Christopher McCray_1
Honored Contributor

Re: Secondary SWAP

Hello,

I'm sorry to say that I'm not familiar with that option (at least as you put it). Is it not possible, since you are doing this from the install CD, to merely increase your swap+dump area? Have you considered creating device swap on other vgs?

Chris
It wasn't me!!!!
Stefan Farrelly
Honored Contributor

Re: Secondary SWAP


Tricky. I dont know why you have to have a secondary swap area on lvol3 ? As pointed out already all vg00 is usually on the same disk so no benefit to having 2 swap areas on the one disk - might as well make it all primary swap.

You could easily just not create it from the install menu, let your server boot, then create a new lvol (probably it will be lvol9) and set this up as secondard swap.

Im from Palmerston North, New Zealand, but somehow ended up in London...
Kenneth_18
Frequent Advisor

Re: Secondary SWAP

Hi, thank you both for your quick response. I dont know exactly how the application I will install will use the secondary swap space. But I've seen on a production server with that same application that I will install, it has primary swap on lvol2 and secondary swap on lvol3. Its easy to create a new lvol on the system once its already up but then it wont be contigeous as the secondary swap will be create on lvol9.
Sajid_1
Honored Contributor

Re: Secondary SWAP

hi,

The secondary swap creation is not h/w dependent. But the way you are thinking will not be possible because of the boot,swap,root specifications. Also configuring the secondary swap on the same disk is not a good choice. The best thing to do is install the OS with primary swap space needed and the normal FS allocations, then create a device swap in another disk and configure it as secondary.

Normally if you have large amount of memory, the creation of secondary swap can be done after observing the system swap usage!

gl,
learn unix ..
Sandip Ghosh
Honored Contributor

Re: Secondary SWAP

Secondary Swap creation is not Hardware dependent.

I don't know why you want to setup the secondary swap on the same disk. We are splitting up the swap into two portion so that during swapping system can access both the swap area simultaneously. Now if you keep both the swap area in the same disk you will not get any improvement in the performance. And none of the application use the specific swap area, it generally uses the whatever swap area available. In that case if you create your secondary swap any where else, it will not harm. Regarding the setting of your present production server, who had created the secondary server may not had think about all these thing.

Sandip
Good Luck!!!
keith persons
Valued Contributor

Re: Secondary SWAP

Just saw this and thought I would respond - yes, prior comments about two swap devices on one disk is not a good idea. This could promote premature disk failure on the system drive. If two swap devices must be configured for whatever reason, the least you should is edit the /etc/fstab file and set the secondary swap priority to 0 (primary defaults to 1 in 11.x and cannot be changed). This will help keep the os from hammering the disk during any swapping that must occur.

You also refer to having lvols 2 and 3 contiguous but this is only relevant to the construction of the primary swap device. Once you move to another swap device the continuity isn't as relevant. If your current lvols are truely constructed to be physically contiguous on one disk, then a single swap device would be advised.
James R. Ferguson
Acclaimed Contributor

Re: Secondary SWAP

Hi Kenneth:

If you need a secondary device swap, build it on a *non* vg00 volume group. I usually set the swap priority to the same value as that of the primary device to allow I/O interleaving between the devices.

If your kernel's 'maxswapchunks' value is large enough, you will not need to increase it and reboot to affect secondary swap creation.

You can use SAM to configure the swap device on any available volume group and with any logical volume name you choose.

Regards!

...JRF...
Sridhar Bhaskarla
Honored Contributor
Solution

Re: Secondary SWAP

Hi Ken,

You should be able to create secondary swap from the advance installation menu. Create a new lvol and assign it as swap in addtion to primary swap. Even if you missed it, you can always create it after the OS is up and running. It is recommended to create secondary swap on a disk other than where the primary swap is located.

#lvcreate -n lvol? -r N -C y /dev/vg??
#lvextend -L size_in_mb /dev/vg??/lvol? /dev/dsk/c?t?d?

swapon /dev/vg??/lvol??

Edit /etc/fstab and add the entry

/dev/vg??/lv?? ... swap pri=1 0 0


This will enable swap interleaving as primary swap is already set to the default priority of 1.

-Sri

You may be disappointed if you fail, but you are doomed if you don't try
Bill Hassell
Honored Contributor

Re: Secondary SWAP

Secondary (and tertiary...) swap volumes do not have to be contiguous--that is a primary swap lvol requirement only. The system will use chunks out of the various swap volumes as needed and based on priority (lowest number such as 0 gets used first, equal priorities are assigned in round-robin manner).

However, swapping (actually, paging) is generally a bad thing and only happens when there isn't enough RAM to hold everything in memory. If your applications run very interactively (ie, waiting on keyboard input) then having lots of swap space and small RAM is fine. The paging activity will be of little consequence (small processes swap in and out as needed).

But if two or more busy processes that run for many minutes to hours with no keyboard inputs (and they don't all fit into RAM at the same time), then the swap areas will indeed be hammered, but as a consequence, the total elapsed time for all the processes will increase 10-100x longer! Spending long hours optimizing swap will do nothing to decrease the penalty of heavy swapping. Adding RAM dramatically increases performance when the system is heavily paging.

So check the other system with swapinfo -tm and vmstat. Is the device file swap space actually being used? Does vmstat show non-zero values under the po (PageOut) column? If not, you don't need to waste space by allocating so much swap space. Swap space and RAM constitutes all of virtual memory and programs run in virtual memory,


Bill Hassell, sysadmin