Operating System - HP-UX
1833696 Members
3036 Online
110062 Solutions
New Discussion

Re: Increasing swap space

 
SOLVED
Go to solution
Chris Fadrowski
Super Advisor

Increasing swap space

I would like to increase my swap with secondary swap space to make it easier. Can i put a 4 gb partition or LV on fiber channel disk on a clarion system? Or is this not a good idea?

I assume all i would have to do is carve out a 4 gb vg and lv on some disk and use the swapon command. Am i correct in my thinking?
10 REPLIES 10
Steven E. Protter
Exalted Contributor

Re: Increasing swap space

You probably can add swap in fiber channel.

Its a bad idea, because if the fiber channel goes down your system will halt suddenly. This can corrupt databases and cause a world of problems.

When possible, I try and boot off a local, mirrored disk and keep swap on local disk.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Chris Fadrowski
Super Advisor

Re: Increasing swap space

I was told by HP not to put secondary swap on the ROOT disks. they said it would hurt performance. I Have 2 internal disks that are mirrored and all the other disk is EMC.

I completely understand what you are saying however and it makes sense. Would you suggest making another VG and LV on the root disks with some free space and making it 2nd'ary swap?
Pete Randall
Outstanding Contributor

Re: Increasing swap space

Chris,

As long as your primary swap remains on your root disk, you should be fine. Losing secondary swap would mean your performance would be degraded, but without your clarion what work are you going to be doing anyway?


Pete

Pete
Patrick Wallek
Honored Contributor
Solution

Re: Increasing swap space

Well, the first question I have is why do you need an additional 4GB of swap? Are you actually paging out? If you are paging out your performance is going to be BAD anyway. To quote Clay worrying about swap performance is like "rearranging the deck chairs on the Titanic".

The only real reason to have swap space is so you can use all of your RAM. If you actually are paging out, it's time to buy more RAM.
Chris Fadrowski
Super Advisor

Re: Increasing swap space

I was paging out last week. I installed 8 gb more of memory yesterday (IA64 rx4640) server for a total of 16 gb of RAM. I had 8 gb, and my swap was 4 gb. My swap is still 4 gb but wanted to increase it to reflect closer to the 16 gb of RAM that is now in the box. I was also told that i should have at least a one for one on swap and memory.
Patrick Wallek
Honored Contributor

Re: Increasing swap space

That is true. If you want to use all of your RAM, then you must have swap equal to RAM.

UNLESS you have the kernel parameter swapmem_on set to 1. If that is 1, then the kernel will do a calculation and use approximately 75% of RAM as pseudo-swap. Note that this is just for internal kernel book keeping and your available RAM will not be impacted.

So, in your case you can have 16GB of swap so that you can use your 16 GB of RAM.

Or you can set swapmem_on to 1 which will use 16GB x .75 = 12GB pseudo swap + 4GB device swap = 16GB. So you still have 16GB available and can use all of your RAM.

If you really want to add 4GB more of swap you can, but I'm not sure I'd worry right now. If it turns out you need it later, you can always add swap on the fly.

One thing you may want to do, if you can get time for a reboot, is go ahead and max out your maxswapchunks kernel parameter. Set it to 16384 (I think that's the max). This kernel parameter, more often than not, is the stumbling block to adding more swap to a system. Setting it to its max value will not use any memory or any kernel resources, so no worries there. It just means you can actually add swap if/when you need to.
Chris Fadrowski
Super Advisor

Re: Increasing swap space

i have swapmem_on=1, and i have also maxed my swchunk at 16384. max swap chunks is no longer a parameter in 11.23v2.

I was still paging at 100% in glance when i had 8 gb of memory. I am looking to make sure i can increase my performance on this box. As it stands now, i have 16 gb of mem and my swap is 4 gb with the two parameters set above.

So you guys think this is effiecient at this point?
Patrick Wallek
Honored Contributor

Re: Increasing swap space

I think it is fine.

Was your device swap actually 100% used?

Remember that the 'memory' and 'total' lines of 'swapinfo -tam' may mislead you. Just because they get high doesn't mean you are paging. If the 'dev' line was 100% then you were having problems and I imagine performance was pitiful.
Chris Fadrowski
Super Advisor

Re: Increasing swap space

I am no longer paging at 100% since i installed the add'l 8 gb of mem. I was just told by HP that my swap should be the same as my memory. And currently it's NOT. its 12 gb less and was wondering if my performance is suffering cuz of it.
Patrick Wallek
Honored Contributor

Re: Increasing swap space

If you have glance, open it and look at your RAM utilization. Are you using more than 4GB or RAM? If so, then you are fine.

Have you gotten errors due to processes not starting because they can't reserve swap space? No? Then you are fine.

You could also take a look at your 'swapinfo -tam' output. You should see a 'memory' line. That line should have an available value of about 12GB. It will show some usage. Don't worry. Also your 'total' line should show 16GB available (dev + memory). If that is the case, then you are fine.

The swapmem_on kernel parameter was designed for just this case. Point out to whomever at HP that you have swapmem_on set to 1. They *should* know what this means. If they don't they need to talk to someone that knows something so they can learn.