1748036 Members
5089 Online
108757 Solutions
New Discussion юеВ

Re: Swap space for Linux

 
Shehan
Super Advisor

Swap space for Linux

Hi All

I am going to install RHEL5 for the DL580 server. It has 8GB RAM. But I don't know most suitable swap space for the 8GB RAM Space. Please help me to solve this out.

Regards
Nirukshitha
14 REPLIES 14
Sajjad Sahir
Honored Contributor

Re: Swap space for Linux

Dear Friend

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

Swap space == Equal RAM size (if RAM < 2GB)
Swap space == 2GB size (if RAM > 2GB)
Swap space == Equal RAM size (if RAM < 8GB)
Swap space == 0.50 times the size of RAM (if RAM > 8GB)


thanks and regards

Sajjad Sahir
Shehan
Super Advisor

Re: Swap space for Linux

Dear Sahir

As per the customer requested, I kept 32GB SWAP sapce for 16GB memory. My HDD is 146GB and created 8GB x 4 SWAP sapce instead of creating 32GB swap sapce. So let me know that any thing wrong with this config.

Regards
Nirukshitha
Michal Kapalka (mikap)
Honored Contributor

Re: Swap space for Linux

hi,

i think the SWAP space should be contignues if its on one HDD, if each SWAP is on separated physical HDD them your option will be the best to the performance.

mikap
Shehan
Super Advisor

Re: Swap space for Linux

Hi
I have created these all swaps on a one disk.So may I able to get all 4 swaps into one swap now? Or else , if i use this as it is, will it be issue for the perfomance?

Regards
Nirukshitha
Michal Kapalka (mikap)
Honored Contributor

Re: Swap space for Linux

Hi,

check fdisk -l /dev/your_disk

and if the swaps are together it could be ok,

but if there are some partitions between the disk wiil be slower as if you are use one SWAP.

mikap

PS : in my opinion is to use better one swap instead of many on the same disk !!!.

the swap shhould be always contigues, if isn;t the head on the HDD will spin betveen 2-4 swap areas, and of course the speed will be decreesed !!!
Shehan
Super Advisor

Re: Swap space for Linux

Hi
What is the possibility of deleting all 4 existing swaps and create one 32GB swap?

Regards
Nirukshitha
dirk dierickx
Honored Contributor

Re: Swap space for Linux

just remove them and create a new one, nothing special about it. can be done on a running system.
Shehan
Super Advisor

Re: Swap space for Linux

Dear Dirk

Can you please point out the commands?

Regards
Nirukshitha
Ben Stokes
Frequent Advisor

Re: Swap space for Linux

Hi

Just my humble opinion but 32Gb of disk space for swap is wasteful.

Official guidance from Red Hat is a minimum of 16Gb of swap for 32Gb of RAM. http://kbase.redhat.com/faq/docs/DOC-15252

Personally I would stick to the 16Gb minimum - in my experience once a server has used more than around 4Gb of swap performance of the whole server will be significantly affected.

32G of physical RAM should be ample for most applications, but the rules for swap are different for some applications, for example Oracle has specific guidlines for their own software. What are you planning to run on this server?