Hi,
Any recommendation to set SWAP Partition in CentOS 5.8 on 32GB Physical Memory Box and also how does swap partition is being used and any utility to know when was swap partition being used.
Regards,
Kaushal
Kaushal Shriyan wrote:
Any recommendation to set SWAP Partition in CentOS 5.8 on 32GB Physical Memory Box and also how does swap partition is being used and any utility to know when was swap partition being used.
In the Days of Yore, received wisdom was 2-2.5 times RAM. For the last five or so years, with the massive growth of RAM, it's been 2G for pretty much everything. The system will use it mostly as a last resort, if it's being overwhelmed.
mark
On Mon, Jun 18, 2012 at 2:19 PM, m.roth@5-cent.us wrote:
Kaushal Shriyan wrote:
Any recommendation to set SWAP Partition in CentOS 5.8 on 32GB Physical Memory Box and also how does swap partition is being used and any utility to know when was swap partition being used.
In the Days of Yore, received wisdom was 2-2.5 times RAM. For the last five or so years, with the massive growth of RAM, it's been 2G for pretty much everything. The system will use it mostly as a last resort, if it's being overwhelmed.
Yes, if you actually need/use more than 2G swap, the system will likely be so unresponsive that you'll think it is dead and reboot anyway. As for seeing if it is used, 'top' and 'free' will show it, or you can track activity with vmstat.
This is actually from RHEL admin guide but should be appropriate for CentOS as well:
Table 6.1. Recommended System Swap Space Amount of RAM in the SystemRecommended Amount of Swap Space4GB of RAM or lessa minimum of 2GB of swap space4GB to 16GB of RAMa minimum of 4GB of swap space16GB to 64GB of RAMa minimum of 8GB of swap space64GB to 256GB of RAMa minimum of 16GB of swap space256GB to 512GB of RAMa minimum of 32GB of swap space
On Mon, Jun 18, 2012 at 06:30:28PM -0400, Christina Salls wrote:
This is actually from RHEL admin guide but should be appropriate for CentOS as well:
Let me un-windoze your table: (you should consider using a text-based mail agent on Unix lists).
<PRE>
Table 6.1. Recommended System Swap Space
Amount of RAM in the System Recommended Amount of Swap Space 4GB of RAM or less a minimum of 2GB of swap space 4GB to 16GB of RAM a minimum of 4GB of swap space 16GB to 64GB of RAM a minimum of 8GB of swap space 64GB to 256GB of RAM a minimum of 16GB of swap space 256GB to 512GB of RAM a minimum of 32GB of swap space
</PRE>
The problem with this -- it seems to assume that swap requirements are based on system memory. I'm not intimately familiar with the Linux kernel, so I have a few questions: (These are T-F).
1) The linux kernel does not swap at all, but only pages. (Swap == copy entire image to disc, and suspend it. Page == copy certain memory pages to disc when core becomes exhausted.)
2) The linux kernel does not copy the entire image to the page file to start execution. (This was done on some older OSes, one copied the whole image to swap/page, then faulted the page with the entry point, which got the ball rolling. Initially this was a copy to "drum" from tape or cards, but there was for a long time situations with slow vs fast storage.) Instead, pages are initially paged in from the regular normal disc image of the program or from dynamic load libraries.
3) The practical upper limit on swap [sic] file size are the page maps in the kernel, (which map pages of VM to blocks in the swap file), since these maps (naturally) cannot be paged.
4) Linux kernel memory may not be paged, any of it, ever. (This is true of some other systems.)
5) The amount of swap/page required in a system is a function of the number and size of (pseudo)-simultaneously executing images.
6) The recommendations in the table are ad hoc estimates based on questions (5) and (3) being answered "TRUE".
7) Memory-mapping a disc file with mmap(2) places no demand on system page files.
8) The Linux kernel itself has no requirement at all for a page file or partition.
Thanks to the list for any answers!
Dave