1834462 Members
2961 Online
110067 Solutions
New Discussion

Increase in Swap space

 
SOLVED
Go to solution
santy1
Advisor

Increase in Swap space

Here i want to increase the swap space by 1GB. As the applications team has some issues. so the Appl's team has suggested us
to increase 1GB swap space based on there findings.
Please check the attached doc for more details...so that you can answer my Q's clearly..

this is my current swap info on the server

# swapinfo -tam
Mb Mb Mb PCT START/ Mb
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 4096 505 3591 12% 0 - 1 /dev/vg00/lvol2
reserve - 3237 -3237
memory 4085 979 3106 24%
total 8181 4721 3460 58% - 0 -
------------------

can i go with this steps to create 1Gb swap space

# lvcreate -L 1G /dev/vg00 ( please check this command i want to increase SWAP by 1 GB)


# lvdisplay /dev/vg00/lvolx


# swapon /dev/vg00/lvolx

# cd /etc/fstab

/dev/vg00/lvolx swap defaults 0 0 (please check this entry is it ok)


Thanks in advance
28 REPLIES 28
IT_2007
Honored Contributor

Re: Increase in Swap space

There is a swap already running on your system on vg00 which is lvol2. This is a primary swap. If you have free space on other volume group other than vg00 then it is a good idea to create.

Above steps are good to go.
Jaime Bolanos Rojas.
Honored Contributor

Re: Increase in Swap space

Santy1,

Please take a look at this thread, somebody got almost exactly same issue that you are having right now, after reading it, you might want to ask the development team why they want to increase swap, and why creating primary is not a good idea at this stage, secondary swap will do the trick.

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1063451

Regards,

Jaime.
Work hard when the need comes out.
santy1
Advisor

Re: Increase in Swap space

Jaime,

The thread you gave me is my query.

IT_2007>>so can i go with the other VG like /dev/finvol here. But is that a good idea to have swap on the same VG which has applications already running.




and one thing do we need to start any service or any reboots required after creating swap space

V.Manoharan
Valued Contributor

Re: Increase in Swap space

HI
1. you can have swap in different VG as well that is not an issue. It is always good idea to go ahead with different disk where root disk is not present or it should be in seperate disk where i/o is not higher.

2. No need to start any service exclusively when increasing swap.

regards
Mano
Jaime Bolanos Rojas.
Honored Contributor
Solution

Re: Increase in Swap space

Hi again Santy1 :-)

I did not realize that :-).

The thing with primary swap, is that it has to be strict and contigous and that does not let us use the vg00 to extend the existing swap space.

This been said, creating secondary swap is the solution, but creating that extra space on the same drive that vg00 is located is not a good idea, since you will not be gaining any performance, your drive only have one head to write with, so using a second drive is the solution


Use the syntax given by James R. Ferguson in this thread:

http://forums1.itrc.hp.com/service/forums/bizsupport/questionanswer.do?threadId=1028045

Regards,

Jaime.
Work hard when the need comes out.
IT_2007
Honored Contributor

Re: Increase in Swap space

To achieve good performance, create and use secondary swap on local disk other than vg00.
santy1
Advisor

Re: Increase in Swap space

here ...

/dev/finvol is part of cluster so can i use this to create secondary swap.
Deoncia Grayson_1
Honored Contributor

Re: Increase in Swap space

I would not use a shared filesystem to add swap to a server and I'm pretty sure its not recommended. Do you have another volume group on your sever outside of vg00 that is not apart of the cluster? I would use that voluome group to add more swap space.
If no one ever took risks, Michelangelo would have painted the Sistine floor. -Neil Simon
A. Clay Stephenson
Acclaimed Contributor

Re: Increase in Swap space

/dev/finvol is part of cluster so can i use this to create secondary swap

If that means that /dev/finvol is a shared volume then absolutely, positively do not use this as swap space. Consider what would happen if multiple hosts were actually using this as swap space. Absolute chaos would be the result.

If it ain't broke, I can fix that.
santy1
Advisor

Re: Increase in Swap space

No i dont have any other VG other then /dev/vg00 and /dev/finvol....now can i have any alternate to crete secondary swap.... you can have a details in my first post in the attached DOC.
IT_2007
Honored Contributor

Re: Increase in Swap space

you can create logical volume for swap on /dev/finlvol using your steps.
santy1
Advisor

Re: Increase in Swap space

But according to Clay it is not recommended to cretae secondary swap on the shared VG /dev/finvol which is part of cluster.
A. Clay Stephenson
Acclaimed Contributor

Re: Increase in Swap space

You have plenty of space in vg00 for an additional swap volume. Pay absolutely no attention to those who tell you to spread swap around. All of your effort to optimize swap layout is equivalent to rearranging the deck chairs on the Titanic when you begin to swap to any significant degree. The only concession to performance that I would make is to set the priority of this additional swap to something other than 1.
It's okay to cvreate the additional swapspace in the finvol as long as this is not shared but I would prefer a local disk and you do have room in vg00.

If it ain't broke, I can fix that.
IT_2007
Honored Contributor

Re: Increase in Swap space

Didn't read Clay's answer, and thought finlvol is local,not shared. Agree with Clay. you can create swap volume on vg00.
Deoncia Grayson_1
Honored Contributor

Re: Increase in Swap space

even though most wouldn't agree to creating a secondary swap in vg00, but since you don't have many options and you have more then enough space to create additional swap space, then you can create additional swap space with the steps you listed.

absolutely, positively do not put it on your shared voludme group, you're asking for trouble...
If no one ever took risks, Michelangelo would have painted the Sistine floor. -Neil Simon
Jaime Bolanos Rojas.
Honored Contributor

Re: Increase in Swap space

Santy1,

There is another option, this one is kind of neat, you can make a tape recovery with ignite, then restore the system with it, when booting off the tape go into interactive mode and change the size for your primary swap this will allow you to increase its size and have it strict and contiguous.

Regards,

Jaime.
Work hard when the need comes out.
santy1
Advisor

Re: Increase in Swap space

Okie so now i can go ahead and create a new LV under /dev/vg00 and use it for secondary swap area.


Thnx All for the info. provided.
santy1
Advisor

Re: Increase in Swap space

I got the below error while trying to create LV on /vg00. Even though i have much space here..it is not allowing me to create one LV of 1GB

# lvcreate -L 1G /dev/vg00
lvcreate: Specified LogicalVolumeSize is too large for the PhysicalExtentSize
of the Volume Group. Resulting number of extents is out of the range
1 to 65535 (0).
# vgdisplay /dev/vg00
--- Volume groups ---
VG Name /dev/vg00
VG Write Access read/write
VG Status available
Max LV 255
Cur LV 8
Open LV 8
Max PV 16
Cur PV 1
Act PV 1
Max PE per PV 4237
VGDA 2
PE Size (Mbytes) 8
Total PE 4227
Alloc PE 2671
Free PE 1556
Total PVG 0
Total Spare PVs 0
Total Spare PVs in use 0
santy1
Advisor

Re: Increase in Swap space

now i have created swapspace of 1 GB please check the output of swapinfo -tam in my first post and now.


# swapinfo -tam
Mb Mb Mb PCT START/ Mb
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 4096 725 3371 18% 0 - 1 /dev/vg00/lvol2
dev 1000 0 1000 0% 0 - 1 /dev/vg00/lvol9
reserve - 2640 -2640
memory 4085 1033 3052 25%
total 9181 4398 4783 48% - 0 -
#
can anyone tell how to read it now...i can see 2 dev now. how much free swap i have now...basically how to read it bit confused...
A. Clay Stephenson
Acclaimed Contributor

Re: Increase in Swap space

TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 4096 725 3371 18% 0 - 1 /dev/vg00/lvol2
dev 1000 0 1000 0% 0 - 1 /dev/vg00/lvol9

This means that you are using 725 MiB on lvol2 and that's it. In fact, you may not be using any swap because this could be memory-mapped files. I actually suspect that you aren't really swapping because notice that none of your added swap is being used eventhough the priority matches that of the primary swap partition. Note the "Memory" line in your swapinfo output; that indicates that's pseudoswap has been enabled. The only thing that I do not like is the very thing I suggested that you do not do. You set the priority of the additional swap to 1 matching that of prmary swap. When your box actually begins to swap, because these swap areas are on the same physical disk, the head will be moving like crazy as it interleaves the swap. You should modify the /etc/fstab of this additional swap area and set it to anything EXCEPT 1 so that first one area will be completely used and then the other area will be used. You only set priorities equal when you are using separate physical disks so that the i/o is then spread across them. HOWEVER, this really doesn't matter because at this point you are rerarranging the deck chairs on the Titanic.

If it ain't broke, I can fix that.
santy1
Advisor

Re: Increase in Swap space

Clay please suggest me here,

this is the entry i have in /etc/fstab

# grep -i /swap /etc/fstab
/dev/vg00/lvol9 /swap defaults 0 0
#

But as you said i can't see the first swap that is primary swap entry in /etc/fstab file..so how to check the priority and set it....please help me here
Sp4admin
Trusted Contributor

Re: Increase in Swap space

santy1,

Here is a copy of my swapinfo. I think you need to create extra swap on another volum group.

# 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
dev 8172 5076 3096 62% 0 - 0 /dev/vg04/lvol1
reserve - 5119 -5119
memory 6291 3256 3035 52%
total 18559 13451 5108 72% - 0 -


sp,
santy1
Advisor

Re: Increase in Swap space

Already i have created secondary swap on same VG00....if you can see the whole thread it will be clear to you...

Can anyone help me here as Clay said to change the priority. HOW CAN I CHNAGE THE PRIORITY. Please suggest....You can see the /etc/fstab entry in my previous post...

# swapinfo -tam
Mb Mb Mb PCT START/ Mb
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 4096 679 3417 17% 0 - 1 /dev/vg00/lvol2
dev 1000 12 988 1% 0 - 1 /dev/vg00/lvol9
reserve - 3058 -3058
memory 4085 1033 3052 25%
total 9181 4782 4399 52% - 0 -
#
A. Clay Stephenson
Acclaimed Contributor

Re: Increase in Swap space

As I said, you really don't have to worry about it because you are rearranging the deck chairs on the Titanic. Simply edit /etc/fstab and change the "pri=1" entry to "pri=2" and the priority will be changed on the next boot. I would not let this worry me because anytime swap and performance collide in the same sentence, you are already in trouble.
If it ain't broke, I can fix that.