cancel
Showing results for 
Search instead for 
Did you mean: 

Swap management in HP-UX 11.23

SOLVED
Go to solution
Sreer
Valued Contributor

Swap management in HP-UX 11.23

Hello Gurus,

 

I need a help for deciding my swap usage in my 11.23.

 

Server details:

 

# uname -a
HP-UX rx260-04 B.11.23 U ia64 2549057637 unlimited-user license
[rx260-04]/
#
[# swapinfo -tam
             Mb      Mb      Mb   PCT  START/      Mb
TYPE      AVAIL    USED    FREE  USED   LIMIT RESERVE  PRI  NAME
dev        2048       0    2046    0%       0       -    1  /dev/vg00/lvol2
dev         512       0     510    0%       0       -    1  /dev/vgdata/lvswap
reserve       -     493    -493
memory     2037     607    1430   30%
total      4597    1100    3493   24%       -       0    -
[rx260-04]/
#
[rx260-04]/
#
[rx260-04]/
# kctune | grep -i chunk
swchunk                         2048    2048
voliomem_chunk_size             65536  Default
[rx260-04]/
#

 

I have 2 swaps as

dev        2048       0    2046    0%       0       -    1  /dev/vg00/lvol2
dev         512       0     510    0%       0       -    1  /dev/vgdata/lvswap

 

I think We can have only one primary swap in a server?  if so "  /dev/vg00/lvol2" is my Primary swap ?

 

And "/dev/vgdata/lvswap"  is the secondary swap only?

 

My Server's Total memory is 

 

# machinfo | grep "Memory"
Memory = 2036 MB (1.988281 GB)
[rx260-04]/
#

 

So My Physical memory = 2GB

 Current swap = 2048M + 512M =  2.5GB

 

To calculate my swap :

System Swap = maxswapchunks * swchunk * 1k

 

Iam not getting the value of  " maxswapchunks"  is it a kernel parameter? But kctune is not giving any o/p in 11.23 ?

 

OR can I use the maxswapchunk always as 16384? The man page is confusing...

 

I think in any server by default max swap memory can be as 32GB [using the abov formula]??

 

If I need to use more than 32 GB then only I need to change the swapchunk  value to more than 2MB?

 

So If I need to use 50GB as my swap

 

16384 X swapchunk X 1 = 51200

So swapchunk must be as 3.1MB ?

So do I need to set the swapchunk value as around 3072 Blocks [3MB aprox]??

 

Please correct me if iam wrong....

 

Rgds

Sreekumar

 

 

5 REPLIES
Dennis Handly
Acclaimed Contributor

Re: Swap management in HP-UX 11.23

>If I need to use more than 32 GB then only I need to change the swapchunk  value to more than 2MB?

>So If I need to use 50GB as my swap

 

If you need this much swap, it better not be for this machine, it will be very slow.

Instead get 50 Gb of RAM and you can use pseudoswap instead of swap.

Ken Grabowski
Respected Contributor
Solution

Re: Swap management in HP-UX 11.23

NO there is no kernel parameter in 11.23 of later for "system maximum number of swap chunks", it is a hard fixed number at 16384 . The only adjustable value you have to work with is the swchunk value. Your math is almost correct.  Default max is 32GB, and your desired max is 50GB.  So divide 32 by 50 = .64. Now divide 2048 by .64 = 3200.  So a swchuck of 3200 will give you a swap max of 50GB.

 

That takes us to Dennis reply. He is correct that the system your working with will probably never be able to make use of 32GB let alone 50GB. How much is needed for swap space is driven by the amount of real memory installed and the requirements of the application being run.  Rule of thumb ranges from 1 time real memory to 2 time real memory. But as memory gets huge, those can go by the wayside, and application requirements then set the target swap size.

 

You have 2GB of installed memory and 2GB+ of swap configured. Unless have a specific swap need for more than 1.25 time memory what you have is fine.  If your used swap disk space stays at 0% or near it, you have no memory pressure and do not need more swap or real memory. Unless, of course, you have an application that calls for it. You can use glance or vmstat to monitor your swap disk usage.

 

Sreer
Valued Contributor

Re: Swap management in HP-UX 11.23

Hi Ken Hi Dennis,

 

Thanks for your replies and support.

 

You have cleared my concerns in swap. I will confirm Pseudo swap is enabled after increasing my Physical RAM.

 

Rgds

Sree

Dennis Handly
Acclaimed Contributor

Re: Swap management in HP-UX 11.23

>I will confirm Pseudo swap is enabled

 

It's enabled since you have this line:

memory     2037     607    1430   30%

Sreer
Valued Contributor

Re: Swap management in HP-UX 11.23

Yes :)