Start networking and exchanging professional insights

Register now or log in to join your professional community.

Follow

What is the recommended size of swap partition?

user-image
Question added by Mostafa Mohamed Abdelrahman Mohamed , Senior Virtualization and Application Management Executive , Qatar National Bank - ALAHLI
Date Posted: 2014/10/20
Muhammad Anzar
by Muhammad Anzar , DevOps/DevSecOps Architect , Confidential

Red hat recommends setting as follows for RHEL5:

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 Linux5 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 about3/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 that1) At installation time when configuring the swap space there is no easy way to predetermine the memory a workload will require, and2) The more RAM a system has the less swap space it typically needs, a better swap space

Conclusion

If Linux kernel is going to use more than2GiB swap space at a time, all users will feel the heat. Either, you get more RAM (recommend) and move to faster storage to improve disk I/O. There are no rules, each setup and configuration is unique. Adjust values as per your requirements. Select amount of swap that is right for you.

Bijay kumar Shah
by Bijay kumar Shah , IT Officer , Himalayan Snax and Noodles Private Limited

At-least1.5 times of the physical memory 

More Questions Like This

Do you need help in adding the right keywords to your CV? Let our CV writing experts help you.