linux关于swap分区的划分规则
(以下是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). 大概的意思是: 当物理内存小于2G时,swap大小为物理内存的2倍.超过2G的部分,swap大小跟物理内存相等. 也即是,得到如下公式: x<= 2G的部分, y=2x x>2G 的部分, y=x 利用这个公式,2G物理内存需要4G swap,而3G物理内存则需要5G swap.如果你打算添加内存的话,创建一个大些的swap区是很有帮助的. 举个例子:如果按照分区计划,你的swap区超过2G,那么应该创建另外的swap分区.比如,你需要4G的swap的分区,应该创建2个2G的swap分区. 如果有4G的物理内存,就要6G的swap(根据公式: 2x2GB=4G 1x2GB=2G 上述2个之和.一共6G) 每个swap分区2G.则应该创建3个2G的swap分区. Redhat EL支持多达32个swap文件. 对于超过32G物理内存的,使用小于等于物理内存容量的swap区会更好. |
凌众科技专业提供服务器租用、服务器托管、企业邮局、虚拟主机等服务,公司网站:http://www.lingzhong.cn 为了给广大客户了解更多的技术信息,本技术文章收集来源于网络,凌众科技尊重文章作者的版权,如果有涉及你的版权有必要删除你的文章,请和我们联系。以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢! |