1834089 Members
2504 Online
110063 Solutions
New Discussion

SWAP question

 
SOLVED
Go to solution
Tony Willis_1
Frequent Advisor

SWAP question

OLD DAYS - RAM x 2 maybe 2.25 for swap (initial DEVICE)

After attending a seminar from HP, it appears that
RAM x.25 or 256 MB; whichever is greater is acceptable
for a Database Sever.

I have set my N4000 with 4GB RAM with 1024MB Device Swap
Any comments.
"Not Today,Nice Try, Next Time"
9 REPLIES 9
Kofi ARTHIABAH
Honored Contributor
Solution

Re: SWAP question

I believe that swap should be large enough to hold the largest running program (process) in core... unless you are running some really large programs (databases etc.) you should be fine with 1G swap.
nothing wrong with me that a few lines of code cannot fix!
Alan Riggs
Honored Contributor

Re: SWAP question

1GB is a fine starting place. Bu swap space needs to be watched under expected processing load. The system requires the ability to reserve swap space for any new processes, so you can run into a bind from inadequate swap well before you are actually "using" much swap space.

I also recommend turning memory swap on in the kernel.
James R. Ferguson
Acclaimed Contributor

Re: SWAP question

Tony:

Seems to me that the old rules were fine when memory was scarce. My choice is to watch swap utilization (Glance or swapinfo -ta) and adjust as really necessary.

...JRF...
Patrick Wallek
Honored Contributor

Re: SWAP question

The only problem I have with NOT having as much swap as you do RAM is that when the machine crashes you will not get your entire crashdump file. I don't know if those things are really useful to HP for diagnosing the cause of a crash or not.

I prefer having at least as much swap as I have RAM, so I can get the whole crash dump if necessary. Better to be safe than sorry. And with disk capacity increasing as it is, why not?!

Just my 2 cents.
Ramesh Donti
Frequent Advisor

Re: SWAP question

Hi,
You need to have large amount of swap space, if you are running large programs or databases because it need to allocate virutal address space in swap for forking a new process. So, if you have small swap, you may find yourself in a situation where ur system can't fork any more processes even though your memory is not fully utilized.
Always Keep Smiling
Denver Osborn
Honored Contributor

Re: SWAP question

Patrick brings up a good point, but also keep inmind that 11.0 will not need the 1 to 1 ratio to capture a full dump like 10.20 needed. 11.0 will take specific portions of memory to include with the dump.

To get an idea of how much space you'd need in dump on 11.0 look at crashconf

# /sbin/crashconf -v
John Palmer
Honored Contributor

Re: SWAP question

1Gb is plenty on a server where you are not intending to oversubscribe the memory PROVIDING that you have the kernel parameter swapmem_on set to 1.

If it is 0 (and SAM's 'general database server' template sets it to 0) you will be limited to that 1Gb of data segments.

Denver is correct regarding the amount of dump space required, HP rewrote the crashdump mechanism at 11.00. After all, with amounts of server RAM increasing dramatically, who would want to reserve many Gb's of device swap for use in the unlikely event of a crash.

Regards,
John
Ken Robson
New Member

Re: SWAP question

From HP-UX 10.20 onwards swap is implemented somewhat differently which is why the old rules do not apply. From 10.20 onwards you have a true demand paged memory model, so when things execute they have two types of pages, retrievable and anonymous, retreivable pages are related to things like files on disk and these will no longer be allocated against your swap device, as they can simply be retreived from disk if they ever get kicked from memory, now your anonymous pages are the interesting ones, they cannot be retreived and you must therefore allocate some swap for them, now we have the awkward question of what is swap, well it is no longer your swap device, it is normal demand paged memory, so the swap page will be allocated initially against memory and if accessed enough will remain there, however if the machine starts to become short of memory pages get flushed from the memory cache according to the same rules as any other page and if the page had not been accessed it will be put on the freelist, if it remains there long enough without a page reclaim, it will be re-used, at this point it will be written to the swap device.

This is why you hear statements like if you have enough memory you do not need any swap space, this can be true these days, the rule of 4 came from the days when an entire process, plus all its stack, etc must have a one to one relationship with space on the swap device, this has not been true for a number of years now.

Hope this helps.
Tony Willis_1
Frequent Advisor

Re: SWAP question

Thanks to all! ( Points also.)

This was the replies that I expected.
Good comments all.
swapmem was set to 1.
swap has 1GB DEVICE
and 1GB FILE.
If, after monitoring DEVICE meets the needs,
I will reclaim FILE.

We do not experience "non-hardware" crashes;
tombstone does the trick in 11.

Once again, THANKS for the input.
"Not Today,Nice Try, Next Time"