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).
如果按照分区计划,你的swap区超过2GB,那么应该创建另外的swap分区。
比如,你需要4GB的swap的分区,应该创建2个2GB的swap分区。
如果有4GB的物理内存,则应该创建3个2GB的swap分区。
分析:2GB的物理内存 需要swap 2x2GB=4GB,
超过2GB的2GB 需要swap 1x2GB=2GB。
总共6G,每个swap分区2G,所以是3个2GB的swap分区
对于超过32G物理内存的,使用小于等于物理内存容量的swap区会更好。
转载于:https://blog.51cto.com/xikder/330958