Operating System - Linux
1753473 Members
4892 Online
108794 Solutions
New Discussion юеВ

How much we can give to SWAP if the physical memory is 128GB

 
SOLVED
Go to solution
senthil_kumar_1
Super Advisor

How much we can give to SWAP if the physical memory is 128GB

Hi All,

I am go to install Suse 11 in HP proliant BL460C G6.


How much we can give to SWAP if the physical memory is 128GB

Is 20GB enough?
2 REPLIES 2
Steven E. Protter
Exalted Contributor

Re: How much we can give to SWAP if the physical memory is 128GB

Shalom,

Probably 20 GB is not enough.

Programs reserve swap at run time, even if they will never need it.

You are going to need 64 GB of swap to run this system.

SEP
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
Matti_Kurkela
Honored Contributor
Solution

Re: How much we can give to SWAP if the physical memory is 128GB

On Linux, 20 GB sounds like a good starting point. Unlike HP-UX, Linux memory management does not automatically reserve swap by default.

With modern systems, the old rule of "swap = 2x RAM" is silly: if you have 256 GB of swap and the system is actually using even 10% of it, the system may be responding so sluggishly that you (or your customers) are likely to run out of patience with it, assuming that you're swapping to regular hard disks.

If your swap is located on a SSD-based SAN disk with a huge RAM cache in front of it, the situation may be different... but in that case, your swap starts to seem more like remote RAM, so you might as well plug in more normal RAM to your system instead.

RedHat's recommendation as a starting point for RHEL 5:
1. Systems with 4GB of ram or less require a minimum of 2GB of swap space
2. Systems with 4GB to 16GB of ram require a minimum of 4GB of swap space
3. Systems with 16GB to 64GB of ram require a minimum of 8GB of swap space
4. Systems with 64GB to 256GB of ram require a minimum of 16GB of swap space

Ultimately, the amount of swap required on a Linux system will depend on the workload you're trying to run. Use "swapon -s" to monitor the usage of swap, and add more swap or RAM as necessary.

If you have an application that has a memory-leak bug and cannot have it fixed, having a large amount of swap allows you to run the application for a longer time before you'll need to restart it to reclaim the leaked memory. But that is definitely a work-around, not a fix: if you don't monitor the rate of the leak and restart the application before all the memory + swap is consumed, you'll have to reboot the entire system to recover.

MK
MK