关于Swap分区

Swap分区tip(摘自Redhat官方文档)

Swap should equal 2x physical RAM for up to 2 GB of physical RAM, and then 1x physical RAM for any amount above 2 GB, but never less than 32 MB. 

Using this formula, a system with 2 GB of physical RAM would have 4 GB of swap, while one with 3 GB of physical RAM would have 5 GB of swap. Creating a large swap space partition can be especially helpful if you plan to upgrade your RAM at a later time. 

Tip      

If your partitioning scheme requires a swap partition that is larger than 2 GB, you should create an additional swap partition. For example, if you need 4 GB of swap, you should create two 2 GB swap partitions. If you have 4 GB of RAM, you should create three 2 GB swap partitions. Red Hat Enterprise Linux supports up to 32 swap files. 

For systems with really large amounts of RAM (more than 32 GB) you can likely get away with a smaller swap partition (around 1x, or less, of physical RAM). less

翻译 :当物理内存小于2G时,swap大小为物理内存的2倍。当物理内存大于2G,超过2G的部分,swap大小跟物理内存相等。
即:
    x<=2G的部分, swap=2x;
    x>2G的部分, swap= (2*2G)+( x-2G)
利用这个法则,2G物理内存须要4G swap,而3G物理内存则须要5G swap。若是你打算添加内存的话,建立一个大些的swap区是颇有帮助的。
Tip
若是按照分区计划,你的swap区超过2GB,那么应该建立另外的swap分区。
好比,你须要4GB的swap的分区,应该建立2个2GB的swap分区。

若是有4GB的物理内存,则应该建立3个2GB的swap分区。
Redhat EL支持多达32个swap文件。

分析:2GB的物理内存 须要swap 2x2GB=4GB,
超过2GB的2GB 须要swap 1x2GB=2GB。
总共6G,每一个swap分区2G,因此是3个2GB的swap分区

对于超过32G物理内存的,使用小于等于物理内存容量的swap区会更好。
相关文章
相关标签/搜索