Issue
If add several hundred GB of RAM to a system, do really need several hundred GB of swap space ?
Environment
Red Hat Enterprise Linux 5
Resolution
Currently Red Hat recommends a linear increase to the amount of swap space on a system as the amount of RAM increases. Specifically that swap space on a system be twice the amount of RAM when the system has up to 2GB and the amount of RAM plus 2GB when the system has more than 2GB of RAM. This is pretty much the same recommendation as upstream so the reasoning behind it is, the larger the system, the larger memory workload that system will likely encounter.
This no longer makes sense as memory sizes have increased up into the hundreds of GBs range.
The reality is the amount of swap space a system needs is not really a function of the amount of RAM it has but rather the memory workload that is running on that system. A Red Hat Enterprise Linux 5 system will run just fine with no swap space at all as long as the sum of anonymous memory and system V shared memory is less than about 3/4 the amount of RAM. In this case the system will simply lock the anonymous and system V shared memory into RAM and use the remaining RAM for caching file system data so when memory is exhausted the kernel only reclaims pagecache memory.
Considering that
1) At installation time when configuring the swap space there is no easy way to predetermine the memory a workload will require, and
2) The more RAM a system has the less swap space it typically needs, a better swap space requirements rule for Red Hat Enterprise Linux 5 is:
Systems with 4GB of ram or less require a minimum of 2GB of swap space
Systems with 4GB to 16GB of ram require a minimum of 4GB of swap space
Systems with 16GB to 64GB of ram require a minimum of 8GB of swap space
Systems with 64GB to 256GB of ram require a minimum of 16GB of swap space
http://kbase.redhat.com/faq/docs/DOC-15252