1833863 Members
2377 Online
110063 Solutions
New Discussion

SWAP : try this one...

 
Q4you
Regular Advisor

SWAP : try this one...

We have a SuperDome with 64G of physical memory. We recently had a debate about what is the right size of swap for large memory systems like this.

Most said we should have atleast 1x physical as device swap or may be 2x. That means we need 60G to 120G of device swap.

We have psuedo-swap on.

I understand in old days when systems came with 128M and 512M memory range the above assumption made sense but with such large phy mem ( 64G) where we plan to run most processes in memory, what should be swap space ?

Gettiing another set of 36G disks for this is not a problem/solution. Just wish to know what is the correct approach for large memory systems ?

TIA

-Q



10 REPLIES 10
RAC_1
Honored Contributor

Re: SWAP : try this one...

You have a 64Gb of RAM. and psuedo_swap on.

When you do psuedo swap on then the kernel calculates the available swap as actual swap space + 75 % of RAM.

This is just a calculation - i.e it inflates the available swap space value-for kernel.

Depending upon what you are running on server, your memory-RAM will be used. If you are applications/programs are memory hungry even 64 Gb will not suffice.
(Like you give more and more to oracle and it takes it and performs even better)
But with moderate memory requirements 64 GB of swap space is more than enough.

psuedo_swap is just for that-to take the advantage of large memory systems.
There is no substitute to HARDWORK
Ravi_8
Honored Contributor

Re: SWAP : try this one...

Hi,

I would have prefer to keep swap same as physical memory size
never give up
Stanimir
Trusted Contributor

Re: SWAP : try this one...

Hi!
Anil is right..
It is true, that with pseudo_swap=on, you shouldn't have any problems with forks.
In this case you must have appoximately
110 GB reserved area. So your unlockable_mem
parameter in Kernel must be enough small.
In this case you souldn't have any paging
on your system.
That means your 60 GB real swap is enough.
Regards.
Stefan Farrelly
Honored Contributor

Re: SWAP : try this one...

Swap should be the same size as physical memory, 64Gb, UNLESS you never intend to run physical memory up to 64Gb usage (in which case you can make swap smaller if you want to). As long as you have pseudo_swap on (which is a safety net in case you run out of swap) you will be fine.
Im from Palmerston North, New Zealand, but somehow ended up in London...
Ryan Green
Valued Contributor

Re: SWAP : try this one...

We have a dome that is partitioned. The largest partition came from the factory with 24GB RAM and only 4G for swap.

The vhand process is what frees up memory when the amount of available memeory drops below a certain amount. Long ago, this is when swapping would start. But not anymore, in large memory systems the memory is marked as deactivated but it is not swapped. If the application tries to access the deactivated memory and the information contained in it is still in tact, then it is marked as active and processing continues.

If your system comes under pressure, the deactivated memory can be overwritten. If things continue downhill from there, then the system will try to use the "virtual" swap. It will start to lock pages in memory. If you reach this level, you're in trouble.

With the swapmem_on set to "on," the system does not use that memory as swap, it is not reserved, contrary to what HP's help desk will tell you.

Each process that starts needs a certain amount of swap space available. The pseudo-swap allows processes to start when you exceed the amount of physical swap available. There is a small amount of overhead involved in this. But your memory remains available for use.

With that said, there may be times when more physical swap is needed. In these cases, you should spread swap out across multiple devices and set them up with the exact same geometry. They should reside on different devices. Primary swap should be small. Primary swap can be set with a priority of "1" and the seconday swap with a priority of "0". By spreading the swap areas across multiple devices, the system will round robin the use of the devices which allows for better performance.

So what do you do? Swampmem_on is recommnded for situations where you cannot configure the amount of physical swap that is needed. As in a system with more memory than disk space or one that just cannot spare any disk space for swap. If you do have enough physical swap space available, then you need to turn swapmem_on to off.

Which way you go is up to you and should depend on what resources are available to you and how the applications behave. It doesn't need to be a religion.

ryan
Sridhar Bhaskarla
Honored Contributor

Re: SWAP : try this one...

Hi,

I think I am late in the debate. Point to note is "swapmem_on" participates only in the number game.

2x is an old m(y)ath and is valid for systems that have less physical memory (< 4GB) and that bottleneck on memory. In these cases, you won't get good numbers from memory for reservations purposes.

For systems with huge physical memory (like yours), you will still be going with ~2x swap space except that .75x is from the swapmem_on parameter.

So, for these systems I would configure 1x Device swap and turn swapmem_on parameter.

Ryan -

With the swapmem_on set to "on," the system does not use that memory as swap, it is not reserved, contrary to what HP's help desk will tell you

I am surprized HP helpdesk told you that.

-Sri

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Q4you
Regular Advisor

Re: SWAP : try this one...

Thanks to you all for you time.

This is what is decided ->

1. Swap space same/more as physical memory

2. psuedo-swap on

3. seconday swap of 16G x 4 created on 4 x 36G drives.

4. swap mirrored on alternate 36G disks
Sridhar Bhaskarla
Honored Contributor

Re: SWAP : try this one...

Hi,

Thanks for promptly assigning the points.

However, the purpose of this point system is to validate the answer so that in future a user can quickly identify the solution. In this particular post, Stephan gave you correct solution. But he is given only 3 points and this means "your answer did not help me but thanks for you time".

You do not need to give points to all. A 0 will do with correct post carrying around 7 points. This will help the future referrers a lot.

Just wanted to brief if you are not aware of the protocol.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Q4you
Regular Advisor

Re: SWAP : try this one...

Okay..Thanks for pointing out Sri.

I am just too spendthrift on points (just another techie guy who expects more for less) I will do better next time :0

Stephen, I will compensate you for your points soon !
Steven E. Protter
Exalted Contributor

Re: SWAP : try this one...

Conventional swap theory is that if physical memory is under 16 Gb, swap should be twice physical memory.

Once physical memory exceeds that, it doesn't make sense to follow that rule, because the swap won't get used anyway.

Where did I hear this? At last years HP-World from a number of HP engineers who spoke publicly. I also did some follow up discussions on the issue one on one and after by email.

It would appear based on real world performance testing that setting up too much swap space slows sytem performance at worst, and best case is simply a waste of disk space that can be allocated for other purposes.


P
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com