Operating System - HP-UX
1846311 Members
3165 Online
110256 Solutions
New Discussion

swap volume (lvol2) is 99%

 
Ashish_29
Occasional Contributor

swap volume (lvol2) is 99%

Hi Everyone,

I have 3 secondary swap volumes apart from the default one ie lvol2.

Problem i am facing is system utilizing 99% from lvol2 though the total free space available for swap is 14GB. % of space being used from other volumes are 80, 51 and 41.

How i should proceed so system utilize swap uniformly from all the volumes. I am getting lot of alerts for the file system is full.

11 REPLIES 11
Pete Randall
Outstanding Contributor

Re: swap volume (lvol2) is 99%

What are the priorities of these various swap areas set to? Run swapinfo and post the results.


Pete

Pete
Ashish_29
Occasional Contributor

Re: swap volume (lvol2) is 99%

Enclosing the output of swapinfo. Priorities are all set to one.

Tim Sanko
Trusted Contributor

Re: swap volume (lvol2) is 99%

Why do you think this is a problem?

The secondary is used when the primary doesn't have available room.

Tim

Pete Randall
Outstanding Contributor

Re: swap volume (lvol2) is 99%

As Tim points out, the primary will be used first unless you alter the priorities.


Pete

Pete
Suraj Singh_1
Trusted Contributor

Re: swap volume (lvol2) is 99%

Just a clarification required..

The attachment mentions that all the swaps have same priority, i.e., 1. How did u guys came to know which one is primary?

Regards
What we cannot speak about we must pass over in silence.
Bill Hassell
Honored Contributor

Re: swap volume (lvol2) is 99%

The primary swap is the first listed in swapinfo. Of course, you can verify this with lvlnboot -v which reports the primary swap area. Swap space is allocated within the same priority by assigning each program to a different swap area. Unless the programs are all the same size, this will be unequal. If a program needs more swap space than the current device, the kernel will then pick the next area.

Now unless you are allocating swap space from filesystems (use: bdf -b and look for extra lines about swap), the filesystem full messages have nothing to do with swap. /dev/vg00/lvol2 is the default primary swap area and there is no filesystem on that lvol. You deal with filesystem full alerts by locating big directories then looking at the contents.

du -kx /problem_filesystem | sort -rn | head -20

As far as all that swap space being utilized, if swapinfo shows a lot of usage, your CPU is starved for RAM. Whenever programs have to be paged out to the swap area, performance is severely impacted. Not only are programs stopped while they are swapped, but actual kernel services are suspended during swap activity. Logins will be delayed, responses on terminals will be held up, in general, things will be really slow.

Swap space is for the occasional RAM overflow, or for hundreds of small programs that are highly interactive. They can be paged out and then paged back in with little impact on other users. Assigning extra swap areas across different controllers makes no perceptible difference because paging causes severe loads on the kernel.


Bill Hassell, sysadmin
Suraj Singh_1
Trusted Contributor

Re: swap volume (lvol2) is 99%

Hi Bill,

Thanks for the clarification.

Is there any way we can do striping of the primary swap space? That would definitely increase performance..

Rgds
What we cannot speak about we must pass over in silence.
Bill Hassell
Honored Contributor

Re: swap volume (lvol2) is 99%

You can stripe a swap volume but it will take some down time unless you have some unused disks. You would create a separate volume group with several disks, or find a VG that has several disks, each with extra space. Then create the striped lvol using LVM commands. The steps to stripe with LVM does depend on the HP-UX version you have.

But after going to all this trouble, I'll bet a pint of Guinness that you can't tell the difference. Note that to "insert" the striped swap volume, your other swap areas should have a priority higher that the new volume. Pri=0 for the stripe, pri=1 or higher for all others. AS I mentioned, disk performance isn't the biggest problem with paging/swapping.


Bill Hassell, sysadmin
A. Clay Stephenson
Acclaimed Contributor

Re: swap volume (lvol2) is 99%

Listen to Bill on this; you are starved for physical memory. I've more or less coined the phrase that "worrying about swap layout is like rearranging the deck chairs on the Titanic". This is the long way of saying it really doesn't matter because your performance is so bad. Your optimization of swap layout might delay the ship sinking by 1 or 2 seconds --- but the ship is still sinking.
If it ain't broke, I can fix that.
Suraj Singh_1
Trusted Contributor

Re: swap volume (lvol2) is 99%

Thanks Bill and Clay.

Ashish, time now to assign points...
What we cannot speak about we must pass over in silence.
Lawrence Mahan
Frequent Advisor

Re: swap volume (lvol2) is 99%

A side note: All swap partitions should be the same size. Otherwise you will never get equal utilization of the swap partitions. What will happen is you will only use the amount of space in each partition that is the same size as the smallest partition.