1833465 Members
2913 Online
110052 Solutions
New Discussion

Re: question about swap

 
SOLVED
Go to solution
dongming
Frequent Advisor

question about swap

Hi
if the disk with secondary swap (not lvol2) crash while the system is running, does it impact system.
do we need make mirror for seconday swap .

thanks
12 REPLIES 12
Patrick Wallek
Honored Contributor
Solution

Re: question about swap

YES!!!! You absolutely need to mirror ALL swap devices / lvols.

If you lose a disk that has a swap lvol on it, you run a VERY HIGH risk of having your system crash.
A. Clay Stephenson
Acclaimed Contributor

Re: question about swap

It may not crash immediately but all swap should be mirrored. Mirroring will allow you to replace the swap disk "on the fly" without having to shutdown. Once the machine is up, all swap areas are essentially equally important.
If it ain't broke, I can fix that.
dongming
Frequent Advisor

Re: question about swap

thanks
but sometime , the secondary swap is huge ,
for example, sap require 25-20G swap space, but the space of internal disk is not enough,how to resolve this problem?
A. Clay Stephenson
Acclaimed Contributor

Re: question about swap

Swap does not have to be on an internal disk. Only primary swap has to be on the boot disk and it can be quite small.

Assuming that you have a machine with enough memory so that swapping does not actually occur, you can set swapmem_on=1 and run just fine with as total swap space as small as ~25% of memory. SAP only requires that huge amount of swap during installation. The installation check for it and then proceeds. You don't need it after that so a good solution is to configure as much swap as you really need to operate and then add the terrible, dreaded filesystem swap to get you up to the 3X memory that SAP install requires. You can then delete the filesystem swap entry in /etc/fstab and reboot and you will be back to normal.
If it ain't broke, I can fix that.
Ajitkumar Rane
Trusted Contributor

Re: question about swap

Hi,

Since the secondary swap will not be available to the system, you may get a degraded performance or a system hang depending on the status of the swap space being used.

If your secondary swap is device swap then it is better that you have it mirrored.

Thanks
Ajit
Amidsts difficulties lie opportunities
dongming
Frequent Advisor

Re: question about swap

hi clay, thanks very much, the following output is from out production server.

# swapinfo
Kb Kb Kb PCT START/ Kb
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 4161536 0 4161536 0% 0 - 1 /dev/vg00/lvol2
dev 12582912 0 12582912 0% 0 - 1 /dev/vg00/lvswap1
dev 4194304 0 4194304 0% 0 - 1 /dev/vg00/lvswap2
dev 4194304 0 4194304 0% 0 - 1 /dev/vg00/lvswap3
reserve - 10486412 -10486412
memory 14244872 2559716 11685156 18%

the usage on phyical swap is 0, do you mean i can remove some on the next down time, is any way to disable swap online.
Ajitkumar Rane
Trusted Contributor

Re: question about swap

The whole secondary swap need not be on a single disk, you can spread it on different disks and possibly on different controllers, this way you get a better performance. But the swap lvol size should remain unifrom on all the disks.

thanks

Ajit
Amidsts difficulties lie opportunities
James R. Ferguson
Acclaimed Contributor

Re: question about swap

Hi:

You asked if you can disable your device swap "online". No, you can't. Delete the secondary device swap entries that you don't want from '/etc/fstab' and reboot. When done, you can remove the useless logical volume that supported them.

Regards!

...JRF...
A. Clay Stephenson
Acclaimed Contributor

Re: question about swap

It's essentially a waste of time these days to talk about swap layout and performance for the simple reason that when you begin to swap to any significant degree, your performance is terrible. I always say that worrying about swap layout is akin to rearranging the deck chairs on the Titanic.

You don't mention how much physical memory you have have but leave at least 25% of RAM configured as swap space and monitor the situation using swapinfo until you are confident that you have enough swap. You cannot disable swap once the machine has allocated it BUT you can remove the /etc/fstab entries while the machine is up. In any event every dab of your swap should still be mirrored and my other configuration rule is that swap space has absolutely nothing to do with dump space and dump space should never be mirrored.



If it ain't broke, I can fix that.
Shameer.V.A
Respected Contributor

Re: question about swap

Hi dongming,
If the disk with secondary swap fails while system is running, system won't go down if the swap space from that lvol is not used. But if it is being used, then it may crash.

It is better to create the secondary swap on the external storage box, which normally will be an AUTORAID box. Then you don't need to mirror it - because storage box will have redundancy depending up on the configuration you have done.

It is adviced to configure secondary swap on lvols which is on different disks with same priority. & lvols which is on same disk on different priority.

Regards,

Shameer

.... See invisible, feel intangible and achieve impossible as everything is possible ....
Chauhan Amit
Respected Contributor

Re: question about swap

Here are some of the Thumb rules for creating secondary swap:

a) Avoid file system swap altogether if possible.
b) Avoid using busy file systems such as the root file system.
c) Avoid using file systems already near capacity.
d) Avoid using file systems on disks that already have swap configured.
e) Set priorities appropriately.
f) Choose faster devices over slower devices.
g) Choose infrequently-used file systems over busier file systems.

Regards,
Amit
If you are not a part of solution , then you are a part of problem
Cem Tugrul
Esteemed Contributor

Re: question about swap

Hi,

would be nice to have a look at the attachment...

Good Luck,
Our greatest duty in this life is to help others. And please, if you can't