Operating System - HP-UX
1838619 Members
2143 Online
110128 Solutions
New Discussion

Swap settings and boundaries

 
SOLVED
Go to solution
Ralph Grothe
Honored Contributor

Swap settings and boundaries

Hello,

I need to provide further secondary device swap by demand of a customer.
(though I doubt they are willing to accept the risk of pageouts or even swapouts, and would rather advise them to tune their application or invest in more physical RAM).
As I interpret it from the current memory usage they are now hardly able to load new processes into memory because all the swap area is already marked reserved by loaded processes.

As I still have sufficient unallocated PEs on vg00's root disks I will lvcreate and swapon a new swap device that will provide further space for swap reservations.

I now just wonder if I interpret the current kernel tunables regarding swap correctly, i.e. I just need confirmation on the units displayed.

These are the current swap parms:

[root@inwo2:/root]
# kmtune -q maxswapchunks -q swchunk -q nswapdev
Parameter Current Dyn Planned Module Version
===============================================================================
maxswapchunks 16384 - 16384
swchunk 2048 - 2048
nswapdev 10 - 10

I would read this as "you can allocate 16384 swap chunks of 2 KB size, which would yield a maximum of approx. 30 GB, or

[root@inwo2:/root]
# echo $((16384*2048))
33554432

The header files I found only "talk" abaout pages (but I thought a mem page were 4 KB)

[root@inwo2:/root]
# grep CHUNK /usr/{conf,include}/sys/swap.h
/usr/conf/sys/swap.h:#define NPGCHUNK ((int)(dtop(swchunk))) /* # pages per chunk */
/usr/include/sys/swap.h:#define NPGCHUNK ((int)(dtop(swchunk))) /* # pages per chunk */


Now what are the used units?

Rgds.
Ralph
Madness, thy name is system administration
6 REPLIES 6
G. Vrijhoeven
Honored Contributor

Re: Swap settings and boundaries

Hi Ralph,

When we reached the limit of 30 GB swap space we changed the swchunk size to 4096 corresponding to the mem page size. This worked fine. If you add the secondairy swap space in vg00, make sure the first one is not havely used ( sar -d/swapinfo -tam ). (I guess SAP is adding an other instance) If so you can get performance bottleneck on vg00. I think the swap space is only used for reservations.

HTH,

Gideon
Dietmar Konermann
Honored Contributor
Solution

Re: Swap settings and boundaries

Hi Ralph,

swchunk is in KB... swchunk==2048 means each chunks 2MB in size. Setting maxswapchunks==16384 gives you a maximum swap space of 16384*2MB == 32GB.

Best regards...
Dietmar.
"Logic is the beginning of wisdom; not the end." -- Spock (Star Trek VI: The Undiscovered Country)
Ralph Grothe
Honored Contributor

Re: Swap settings and boundaries

Hi Dietmar,

thanks for confirmation of units.

Of course did I mean 2 MB per chunk (as set by swchunk).
I sometimes confuse the powers of 10 ;-)
Madness, thy name is system administration
T G Manikandan
Honored Contributor

Re: Swap settings and boundaries

Max.swap space

maxswapchunks * swchunks * 1024.The value is in bytes.

which should equal to around 32GB.

http://docs.hp.com/hpux/onlinedocs/939/KCParms/KCparam.MaxSwapChunks.html
Trond Haugen
Honored Contributor

Re: Swap settings and boundaries

Depending on how much memory there is on the system you could also considder turing "pseudo swap" on if it is not already enabled (swapmem_on 1). It will be on by default and should be left on for systems that has its RAM sized to fit all processes.

Regards,
Trond
Regards,
Trond Haugen
LinkedIn
Ralph Grothe
Honored Contributor

Re: Swap settings and boundaries

Trond,

as you wrote, pseudo swap usage is left on by default.

# kmtune -q swapmem_on
Parameter Current Dyn Planned Module Version
===============================================================================
swapmem_on 1 - 1
Madness, thy name is system administration