1829218 Members
2506 Online
109987 Solutions
New Discussion

Swap Memory Issue

 
SOLVED
Go to solution
Muthyala
Frequent Advisor

Swap Memory Issue

Hi

This is the output of my swap

# 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 4096 174 3922 4% 0 - 0 /dev/vg00/lvol9
dev 4096 175 3921 4% 0 - 0 /dev/vg00/lvol10
dev 4096 174 3922 4% 0 - 0 /dev/vg00/lvol11
dev 4096 169 3927 4% 0 - 0 /dev/vg00/lvol12
dev 4096 177 3919 4% 0 - 0 /dev/vg00/lvol13
dev 4096 174 3922 4% 0 - 0 /dev/vg00/lvol14
dev 4096 175 3921 4% 0 - 0 /dev/vg00/lvol15
dev 4096 170 3926 4% 0 - 0 /dev/vg00/lvol16
dev 4096 176 3920 4% 0 - 0 /dev/vg00/lvol17
dev 4096 171 3925 4% 0 - 0 /dev/vg00/lvol18
dev 4096 172 3924 4% 0 - 0 /dev/vg00/lvol19
reserve - 44658 -44658
memory 39362 27063 12299 69%
total 88514 73628 14886 83%

I have 48GB of system memory and 48GB of Device swap. Swap is always above 90% most of the time.

1. Can I increase more swap size on different volume?
2. If yes, can i increase more than 4GB of device swap or I need to maintain 4GB of device space only.
3. Will it create any performance issues on system if I increase more device swaps, since I have already 12 swap devices?

TIA
Sri
9 REPLIES 9
Bill Costigan
Honored Contributor

Re: Swap Memory Issue

I'm not sure why you created a bunch of 4GB swap deives all in vg00.

The only restriction on 4GB was /dev/vg00/lvol2 and that went away with the newer version of HPUX.

You can create big swap devices and any disks or in any volume groups you want.

The only restriction to the size might be a kernel paramter and those can be changed.

maxswapchunks - Max Number of Swap Chunks
nswapdev - Max Devices That Can be Enabled for Swap
swchunk - Swap Chunk Size (1K Blocks)
VK2COT
Honored Contributor
Solution

Re: Swap Memory Issue

Hello,

Uhh, unless you have multiple phyical volumes
in vg00, you are creating a dangerous
environment from the performance perspective.

Yes, you can add as many other swap devices
as you want, but be careful (see below):

Your 4GB per swap space design is good
but you should spread them across different
physical devices. For example, if you have
SAN, let all other swap devices reside on
different LUNs (or VDISKs).

It is best to leave swap devices at 4GB.
Do not use different sizes for swap devices.

Then, have all swap devices set at same
priority. In other words, your swap devices
will be interleaved in perfect way.

At the moment, if your server starts
swapping, your performance will probably suffer a lot. The disks in vg00 will work
very hard to serve swap and other regular
O/S operations...

Cheers,

VK2COT
VK2COT - Dusan Baljevic
Muthyala
Frequent Advisor

Re: Swap Memory Issue

HI

My maxswapchunks is set to 16384 currently and swchunk to 65536.

So do you think i need to increase them more.

Tia
Sri
Sajjad Sahir
Honored Contributor

Re: Swap Memory Issue

Dear Muthaya

if u want to create a new swap device u have to create in another volume group not in the same volume group.


thanks and regards

Sajjad Sahir

Bill Costigan
Honored Contributor

Re: Swap Memory Issue

If my math's correct - I think that is 1TB of swap space. So you should be more than OK.
Tim Nelson
Honored Contributor

Re: Swap Memory Issue

While you are at it. Why not fix it so it is something more supportable that will not lead you into danger zone.

1) leave primary swap at /dev/vg00/lvol2 alone

2) delete all those other goofy ones and create a 48GB or so secondary.

3) change your swchunk size to 8192

BTW, according to the swapinfo you posted the system is no where near swapping anything out to disk. You could just leave this configuration the way that it is and not worry about it. ( but it will come back to get you later ).


Muthyala
Frequent Advisor

Re: Swap Memory Issue

Hi Tim

Can you be more clear on your your last statement "system is no where near swapping anything out to disk"

And also is there way i can reach you to discuss on this.

Tia
Sri
Tim Nelson
Honored Contributor

Re: Swap Memory Issue

Your swapinfo is indicating minor 4% allocations on a number of your swap devices that have probably been there for awhile. (depends on the last system boot ?)

To be sure run vmstat over a period of time or use glance to monitor. We are looking for page deactivations ( po ).

The memory line in your swapinfo output is for psuedo swap. Tricked in memory swapping that does not really count for anything.

If your system was swapping/deactivating memory pages I would expect a higher percentage after some or all of your swap devices.

Remember, swap usage and swapping ( now called deactivations ) are two different things. HPUX reserves swap space up front when a process starts. It does not mean that the system is swapping/deactivating, need to review with utilities as I mentioned above.


James R. Ferguson
Acclaimed Contributor

Re: Swap Memory Issue

Hi Sri:

> Sajjad: if u want to create a new swap device u have to create in another volume group not in the same volume gro

This is simply not true. However, I agree with Tim --- condense down your secondary swap devices into one large one for a cleaner configuration. Unfortunately to deactivate and eliminate a secondary swap you must remove it from '/etc/fstab' and reboot.

My preference is to have a small primary swap on vg00 and a large(r) secondary device swap on another volume group. I like to make the secondary swap a higher priority (lower value) so it is used preferentially if/when swap I/O ever occurs.

Of course, should you ever actaully swap your performance is degrading anyway, so other than having sufficient swap space for process reservation, this is all moot.

Regards!

...JRF...