Operating System - HP-UX
1833184 Members
3128 Online
110051 Solutions
New Discussion

Re: Yet another (set of) SWAP Questions

 
Alzhy
Honored Contributor

Yet another (set of) SWAP Questions

1. Is their a way to disable swapping to a device (much like swap -d on other Unices)?

2. The A. Clay approach to have a small swap on the boot disk itself with lower priority (higher priority number) than swap devices on other disks will seem to work great. But if one has allocated a pair of exclusive swap disks -- would it be possible/advantageous to instead drop outright having a swap device on the boot/primary disks? Specially if those disks are on its own SCSI bus?

3. Currently on one of our servers, we have this:
Mb Mb Mb PCT START/ Mb
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 4096 177 3919 4% 0 - 1 /dev/vg00/swap
dev 8192 173 8019 2% 0 - 1 /dev/vg00/swap2
dev 16384 177 16207 1% 0 - 1 /dev/vg00/swap3
reserve - 20871 -20871
memory 9361 1668 7693 18%
total 38033 23066 14967 61% - 0 -

This is a 12 GB server, swap2 and swap3 are actually on separate pair of disks (36GB 15K) exclusively for swapping. After adjustig swchunk, I plan to modify this so that I onlyhave one swap device on this disk pair using all 36GB of space on it and set the primary swap's priority to lower (1) and have this new swap device at a higher priority (0)..
Any thoughts/inputs?
Hakuna Matata.
8 REPLIES 8
Patrick Wallek
Honored Contributor

Re: Yet another (set of) SWAP Questions

1) No. Once swap is in use, you can't disable it witout a reboot.

2) This may work since the rest of your swap is in VG00, but I would still have a small primary swap (normally vg00/lvol2).

3) You've got 12GB of RAM, what the heck do you need 36GB of SWAP for? That, in my opinion, is way overkill.
Alzhy
Honored Contributor

Re: Yet another (set of) SWAP Questions

The requirement was actually just 12GB of swap as some processes won't even start. We bumped it to 24 GB, yet some processes won't even exec, start... So we're finally bumping it to using the whole disk pair. Processes onthis server have very large virtual memory requirements... Ave. PhysMem utilization has been constantly above 92% with occasional peaks at 100%. The very signs of a memory starved system are there: pageouts, and deactivations .. but interistingly glance rarely complains of a memory problem..

Here's a Glance Output:

Total VM : 23.9gb Sys Mem : 2.01gb User Mem: 8.85gb Phys Mem: 12.0gb
Active VM: 4.14gb Buf Cache: 491.5mb Free Mem: 671.7mb Page 1 of 1
Hakuna Matata.
Bill Hassell
Honored Contributor

Re: Yet another (set of) SWAP Questions

I doubt VERY much that swap is preventing your programs from starting. As you can see from swapinfo, there is no swap actually used (0%). There is a lot of bad code out there that poorly documented for use on HP-UX. If a process reports it can't get enough memory, it is usually hitting a runaway program fence such as maxdsiz, ulimit or shmmax. And if the processes are 32bit programs, there is a long list of issues with these programs handling more than 1Gb of RAM. For 32bit programs, there are workarounds but you need to review the process management and memory management white papers and learn about chatr and memory windows as well as the kernel fences for large memory programs.


Bill Hassell, sysadmin
Alzhy
Honored Contributor

Re: Yet another (set of) SWAP Questions

Bill, I know it is difficult to effectively (inlay terms) portray a server's memory usage. But in this sever's case, processes actually only start when our SWAP space is large or is made larger.

Note VM Useage which is indicative of how large processes VM requirements are...

Also, have you ever read/heard of the treatise about SWAP being alloacted but not really "used"? A paper from your very own Stephen Ciullo - HPUX Performance Cookbook is a valuable "guide" that I have been relying upon since working on HP-UX environments...
Hakuna Matata.
Jim Butler
Valued Contributor

Re: Yet another (set of) SWAP Questions

I would think you would want to keep a swap area on your boot disk, but it is not mandatory.

The point about setting swap and your actual memory usage is really the key to your problem, though. It sounds to me like you need to do some kernel troubleshooting/tuning to see whats up - I have seen apps require more swap to run, and after I added the swap, then realized (maybe months later) that changing a tunable, actually reduced the requirement for swap.

What are your maxdsiz, maxtsiz, maxssiz,
maxdbcpct, ninodes, maxuprc, semmns,semmnu settings?

Otherwise - go ahead and make the priority for swap3 a pri 1, and make swap and swap 2 a pri 2.

I'll bet you lunch you can improve things with the kernel tuning

Man The Bilge Pumps!
Alzhy
Honored Contributor

Re: Yet another (set of) SWAP Questions

Jim, here it is... boxen is a 4 x 875Mhz vPar on a rp8400. 12 GB Memory.. dual 2GBPS FC.. running about 11 Oracle 9R2 DB instances whose SGA's range from 150MB ro 800 MB... Currently allocated swap is about 28 GB...

* Tunable parameters

STRMSGSZ 65535
create_fastlinks 1
dbc_max_pct 4
dbc_min_pct 3
dnlc_hash_locks 512
hpux_aes_override 1
max_async_ports 3072
max_thread_proc 3072
maxdsiz 0X40000000
maxdsiz_64bit 0X40000000
maxfiles 400
maxssiz 0X17000000
maxssiz_64bit 0X17000000
maxswapchunks 16384
maxtsiz 0X18000000
maxtsiz_64bit 0X40000000
maxuprc 3072
maxusers 800
maxvgs 255
msgmax 65535
msgmnb 440000
msgmni 4096
msgseg 32767
msgssz 2200
msgtql 11000
nclist 5120
nfile 60000
nflocks 4000
ninode 20000
nkthread 14000
nproc 7000
npty 1024
nstrpty 1024
nstrtel 1024
scsi_max_qdepth 16
semmni 4096
semmns 8192
semmnu 1024
semume 512
shmmax 0X600000000
shmmni 1024
shmseg 1024
swchunk 4096
vps_ceiling 1024
Hakuna Matata.
Todd McDaniel_1
Honored Contributor

Re: Yet another (set of) SWAP Questions

Nelson,

First, I would NOT remove the root swap, although it can be done. I would alter any other swap than that one... Your OS looks for that Swap first if you have it set properly, If you have a high use box, I would not alter it for root..

---------------------------
Second, I find it hard to believe you need 36GB of Swap for a system with only 9GB of memory...I too agree your kernel parms are the limiting factors...nfiles/maxdsiz/nproc and the like as mentioned...

The real need for swap is merely for crash dumps usually. With the new method, You only need around 33% of your memory to capture a crash dump... and that has been very adequate for my boxes... Some have as little as 20%....

------------------------------------------
If you think swap is too low you need to be looking at your PAGING activity on your system... THAT and not the actual swap size will tell you if you really need more swap...

-------------------------------------------
My main superdome production has 36GB memory only b/c my Memory is 72GB....

---------------------------------------
I have 2 RP8400s and here are my kernel parms... for one of them... This is my larger one, my Primary TEST box...

I have 14GB of swap and 23.6GB of memory...



#####################################
max_async_ports 50 - 50
max_fcp_reqs 512 - 512
max_mem_window 0 - 0
max_thread_proc 256 - 256
maxdsiz 0x50000000 - 0X50000000
maxdsiz_64bit 0x50000000 - 0X50000000
maxfiles 2088 - 2088
maxfiles_lim 1024 Y 1024
maxqueuetime - - 0
maxssiz 0x800000 - 0X800000
maxssiz_64bit 0x800000 - 0X800000
maxswapchunks 13481 - 13481
maxtsiz 0x4000000 Y 0X4000000
maxtsiz_64bit 0x40000000 Y 0X40000000
maxuprc 25320 Y 25320
maxusers 4096 - 4096
maxvgs 255 - 255
nfile 59712 - (16*(NPROC+16+MAXUSERS)/10+32+2*(NPTY+NSTRPTY+
NSTRTEL))
nflocks 2448 - 2448
nproc 32788 - (20+8*MAXUSERS)
ninode 37332 - ((NPROC+16+MAXUSERS)+32+(2*NPTY))
sema 1 - 1
semaem 16384 - 16384
semmap 1026 - 1026
semmni 1024 - 1024
semmns 22000 - 22000
semmnu 1024 - 1024
semmsl 2048 Y 2048
semume 64 - 64
semvmx 32767 - 32767
shmmax 4294967296 Y 4294967296
Unix, the other white meat.
Todd McDaniel_1
Honored Contributor

Re: Yet another (set of) SWAP Questions

Oops My superdome has 36GB swap and 72GB memory... mistype by me...

no points here...
Unix, the other white meat.