1837149 Members
2181 Online
110112 Solutions
New Discussion

Re: virtual memory rule

 
KVK
Valued Contributor

virtual memory rule

One of my system has 4GB physical memory and virtual memory of 7GB .. It hasn't met 1:2 rule of memory management system . Sombody says above 2GB no need of following this rule as mentioned above .. Please clear the rule of 1:2 and what would be the best for my system ?

Thanks in advance
5 REPLIES 5
A. Clay Stephenson
Acclaimed Contributor

Re: virtual memory rule

There is no rule other than "it depends". Systems with "large" amounts of physical memory often have much less swap space than physical memory as long as swapmem_on=1. Yours is a "medium" size so the only way to know how much is enough is to monitor device and filesystem swap space usage using swapinfo. If you are not using most of your swap space then you have enough. Nowadays the goal is generally to never (or almost never swap) so typically you watch the po (pageout) column of the vmstat output and if
that value is significant (>10-15 or so) for more than a few minutes then you really need more physical memory.
If it ain't broke, I can fix that.
Sudeesh
Respected Contributor

Re: virtual memory rule

Hmm tricky question!! This what Hp say:

"Typically, unless the amount of physical memory on your system is extremely large, the minimum amount of swap space should equal the amount of physical memory on the system. In general, make swap space to be roughly two to four times your physical memory."

Normally in our env we follow general swap rule for physical memory upto 8GB. Above that we keep swap same as physical mem and ensures swap_mem_on is set to 1.

But lot of things depends on application too.

following link may be helpful:
http://docs.hp.com/en/5990-8172/ch06s03.html

Sudeesh


The most predictable thing in life is its unpredictability
Mahesh Kumar Malik
Honored Contributor

Re: virtual memory rule

Hi KVK

1:2 rule for swap is not strigent, but preferred, since system needs to dump full contents of memory to disk in case of crash. For higher memory say 8Gb or above we may keep swap size same as memory but since disk per Mb cost is cheaper nowadays so 1:2 rule may be preferred.

Regards
Mahesh
A. Clay Stephenson
Acclaimed Contributor

Re: virtual memory rule

You don't need 2x RAM for dump space; at most 1X and moreover swap should have nothing to do with dump.
If it ain't broke, I can fix that.
Bill Hassell
Honored Contributor

Re: virtual memory rule

The HP rule is quite outdated. There is no reason to have more than SWAP=RAM today since most systems have at least 1 or 2 Gb of RAM. Swap space is overflow or virtual memory and should only be used for memory-mapped files and the occasional ultra-large jobs that might run once in a while. Using swap space is not a good thing for performance. You'll pay a 100:1 to 500:1 perfomrance slowdown penalty when multiple applications try to run at the same time and they won't all fit into memory. If swapinfo -tm shows 0% usage, that's your clue that you are wasting disk space. As long as the kernel parameter swapmem_on=1, you can run 4Gb of RAM with as little as 1Gb of swap space. As long as swapinfo doesn't show any usage, or during your peak processing periods, vmstat show the po column as a single digit (0-9), you're fine on swap space.

NOTE: Several commercial packages such as SAP will require MASSIVE swap space, perhaps 16-32Gb, but ONLY during installation. Once installed, the swap space can be returned to other uses. The useful command is swapon which adds swap space but only until the next reboot. To keep swap space permenently assigned, add the swap line to /etc/fstab.


Bill Hassell, sysadmin