1830160 Members
10803 Online
109999 Solutions
New Discussion

Memory and swap

 
SOLVED
Go to solution
CSK Auto
Advisor

Memory and swap

I am fairly new to the HP env. On top of that I am a little confused. I have 24 GB of RAM installed on my system however, I am being told that the system isn't seeing the full amount of RAM to be able to utilize it. I am also quite anemic on swap space. I have worked with sr hp admins who suggested that I turn on pseudo swap to utilize the full amount of memory. Also suggested changing the kernel parm maxswapchunks to 16384. How do the people on the forum feel about these two options. What kind of further information can I provide to help?

I have provided output from top and swapinfo

Thanks in advance for any help
Gwenn Culbertson

Also, what are all the points about?
7 REPLIES 7
A. Clay Stephenson
Acclaimed Contributor

Re: Memory and swap

Your top output is useless for this ananlysis because top only knows about memory directly associated with processes; it knows nothing about kernel data structures such as buffer cache.

You need to do a swapinfo -t and a kctune and post those outputs. Also look at vmstat and pay attention to the "po" (pageout) column. It's really the only metric of any value in the vmstat output. This value should be very near 0 preferably at all times. If so, then you are fine.

Essentially if you have less swapspace that physical memory then you should enable pseudoswap (swapmem_on=1). This really isn't swap at all but does allow 75% of your memory to be counted as swap. For example, let's suppose that you have 24GB of memory and 12GB of device or filesystem swap enabled. Without pseudoswap, only 12GB's of processes could be run because that is also the swap that could be reserved (in case the system actually had to page out); if swapmem_on=1 then the system pretends that it has (.75 X 24GB (memory) + 12GB (actual) swap and allows you to fully utilize your available memory.
It's very common on boxes with large amounts of memory to run with small amounts of swapspace. Simply monitor your swap usage with swapinfo; it's so easy to add swapspace that it's not worth worrying about --- as long as you have some free disk space and as long as maxswapchunks has been increased so that the system can actually use the space.


The maxswapchunks does nothing unless you actually add more (actual) swap space. It's a good idea to increase maxswapchunks so that if you ever have to add swap space all you do is issue a swapon command w/o having to rebuild the kernel to allow for more swap space.
If it ain't broke, I can fix that.
Sยภเl Kย๓คг
Respected Contributor

Re: Memory and swap

Hi,
I recomment you to have 24GB of filesystem swap since you have 24GB of memory.

Can u post the kmtune o/p
Regards
Sk
Your imagination is the preview of your life's coming attractions
A. Clay Stephenson
Acclaimed Contributor

Re: Memory and swap

Well, I dont. I have many systems with much more memory than swap space. Why have disk that's never going to be used? That's why I bought all that memory in the first place!

Clay's Rules For swap:

1) Create a small primary swap area (512MB-a few GB's depending on memory) and enable pseudoswap.
2) Create additional secondary swap if needed to bring you up to 25% of physical memory. This can be in another VG.
3) Mirror every dab of swap so that you don't have to shutdown if disk containing swap fails.
4) Monitor the system to see if additional swap is needed.
5) Swap space has absolutely nothing to do with dump space.

Under no circumstances allow yourself to be sucked into the 2-3x memory (4-6x if mirrored) to swapspace ratio rule. That rule has been outdated for more than a decade. Essentially, the current goal is to never swap --- or at least to swap only very rarely.
If it ain't broke, I can fix that.
Victor BERRIDGE
Honored Contributor

Re: Memory and swap

Hi,
The swap determines quantity of memory (RAM) is usable for processes on your system...
Since about 14 GB swap you cannot load more than that quantity in memory... but with swapmem set to 1 your system will be able to use whats left for pseudo swap and not use your disk devices...
So if you want to use all your RAM as memory usable for processes, you will have to have at least as much swap defined on your server!


All the best
Victor
CSK Auto
Advisor

Re: Memory and swap

Obviously my best option is to change out my internals to larger drives and increase my swap on the internal drives. But would it be better to turn pseudo swap on with my existing configuration or put a secondary on my SAN? At this time my primary swap internal mirrired drives are maxed and these are my options.

I have attached kmtune, vmstat and swapinfo -t

Thanks in advance for all your suggestions.

Gwenn
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: Memory and swap

You already have maxswapchunks big enough to accomodate 32GB of swap space. You aren't paging out so you are fine from the perspective of memory pressure. In your case, I would simply set swapmem_on=1 to increase your virtual address space and declare victory.

I would suggest that prior to your reboot to build the kernel that you edit /etc/fstab and change the priority of swap on LVOL's lvol5 and lvol9 to 2 and 3 respectively; iff these LVOL's along with lvol2 (primary swap) are located on the same physical disk. The head will be moving like crazy if all of these share a disk and are at equal priority. Actually this concern is trivial because if you ever begin to swap, disk layout concerns are unimportant (rearranging deckchairs on the Titanic) because performance will be so bad. What I would do while you are rebuilding you kernel is to go to a static buffer cache of about 1200MB by setting bufpages=307200.


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

Re: Memory and swap

Hi,
We have decided that we are going to switch out the internal drives from 36 GB to 73GB and increase swap. Becasue we also have a memory leak issue we believe within PeopleSoft. So we will continie to troubleshoot after we increase swap from 12 GB to 36 GB. Thanks again to everyone for their responses.

Gwenn