Operating System - HP-UX
1832865 Members
2752 Online
110048 Solutions
New Discussion

Re: How much swap space ??/

 
SOLVED
Go to solution
Vipin Singhal
Super Advisor

How much swap space ??/

Hi friends,
I want to know that
how much swap my server has configured?
Swap should be approximately 1.5 times the size of physical memory.
I want to make sure we are configured at or near that for my server.

How will i do?

If you need any command output then i will post it here.
Thanks,
Vipin
14 REPLIES 14
john kingsley
Honored Contributor

Re: How much swap space ??/

Run the command swapinfo
DCE
Honored Contributor

Re: How much swap space ??/

swapinfo will tell the amount of configured and used swap space

You can also use glance to obtain the info on swap
baiju_3
Esteemed Contributor

Re: How much swap space ??/

You can use ,

swapinfo -tam

Thanks,
BL.
Good things Just Got better (Plz,not stolen from advertisement -:) )
HGN
Honored Contributor

Re: How much swap space ??/

Hi

Do a
#swapinfo -mat

This should help.

Rgds

HGN
James R. Ferguson
Acclaimed Contributor
Solution

Re: How much swap space ??/

Hi Vipin:

You already have the answer to your first question from your posting of your 'swapinfo -tam' output in your previous post. You have 24GB of device swap configured.

There is no rule that you need x-times physical memory. You have enabled "pseudoswap" since you see a line marked "memory" in the 'swapinfo' output. This means that 75% of memory is counted as swap space for the purposes of memory accounting. It is not really used, and is of benefit in avoiding ENOMEM (#12) errors when new processes are started.

Regards!

...JRF...
Vipin Singhal
Super Advisor

Re: How much swap space ??/

# swapinfo -tam
Mb Mb Mb PCT START/ Mb
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 4096 570 3526 14% 0 - 1 /dev/vg00/lvol2
dev 20480 575 19905 3% 0 - 1 /dev/vg00/swap2
reserve - 16417 -16417
memory 32735 21107 11628 64%
total 57311 38669 18642 67% - 0 -

# machinfo
....
Memory = 32735 MB (31.967773 GB)
...
....

Swap should be approximately 1.5 times the size of physical memory.
I want to make sure we are configured at or near that for my server.

How will i do?

Pete Randall
Outstanding Contributor

Re: How much swap space ??/

With 32 GB of memory, that would require 48 GB of swap space - that is a huge waste of disk. The 24 GB of swap space that you already have is far more than you need. Unless you are required by your superiors to do this, there is simply no point in increasing your swap space.


Pete

Pete
john kingsley
Honored Contributor

Re: How much swap space ??/

As long as you have pseudo swap enabled, you currently have more swap space then you really need.
Vipin Singhal
Super Advisor

Re: How much swap space ??/

what does pseudo -enabled means?
how will i check?

I will talk 2 my seniors,

if he says to increase the swap space from 24 to 48Gb,

what will be the steps?
Please suggest
thanks
vipin
Pete Randall
Outstanding Contributor

Re: How much swap space ??/

If you must, you need to create a logical volume to contain the additional swap space, enable it with the swapon command, and add it to /etc/fstab - identifying it as swap so it will be enabled during subsequent reboots. Check the man page for "swapon".


Pete

Pete
James R. Ferguson
Acclaimed Contributor

Re: How much swap space ??/

Hi Vipin:

As I indicated, you can tell if pseudo swap is enabled by the presence of a line labeled "memory" in the output of 'swapinfo -tam'. If you don't see a line beginning with "memory" in the first column, then it isn't enabled. The corresponding kernel parameter is 'swapmem_on' and is set to one (1) to enable pseudo-swap or zero (0) to disable it.

If your managament insists on using disk for swap, create a second, or third, device swap space on a volume group *other than* vg00. For example:

# lvcreate -C y -r n -L 4096 -n lvol1 /dev/vg01
# swapon -p 0 /dev/vg01/lvol1
# echo "/dev/vg01/lvol1 ... swap pri=0 0 0" >> /etc/fstab

I suggest that multiple device swap spaces use the same swap priority for best performance and that their priority be algebracically less than primary swap's priority. THus, I have chosen a swap priority of zero (0) in the above example, since primary swap has a priority of one.

Regards!

...JRF...
Edgar_8
Regular Advisor

Re: How much swap space ??/

Hi Vipin,

Yes the rule of thumb says/was that swap should be set at 1.5 times physical memory. Nowadays however if ones applications are not causing alot of swapping or pageing then large swap areas are really nit required.

HTH
Mahesh Kumar Malik
Honored Contributor

Re: How much swap space ??/

Hi Vipin

#swapinfo -tam will provide details on configured swap in system

Regards
Mahesh
Ted Buis
Honored Contributor

Re: How much swap space ??/

The answer to the question about how much device swap is needed is, "it depends". I just saw a system with 16GB of memory and 16GB of device swap (total of 27GB vitual address space) that had use of swap space at 100% and therefore couldn't launch any more processes. There seemed to be other issues as to why the need for virtual address space was so high, but regardless, glance showed why it was not only slow but at times wouldn't respond to commands. Tell me how much virtual address space your application is going to really need with all the users, and the amount of swap is very easy to figure. Ideally your RAM is greater or equal to all the virtual address space you need, but that isn't always the case even with large memory systems.
Mom 6