Linux swap分区大小问题
2016-09-22 10:00
295 查看
几乎所有Linux 系统管理的书上都推荐设置交换分区大小为内存的2倍。这些建议到了现在就是那么适用了,现在的服务器动不动就是 16GB/32GB 内存,难道相应的交换分区也要扩大到 32GB/64GB?根据 OpenBSD 的安装建议:
Many people follow an old rule of thumb that your swap partition should be twice the size of your main system RAM. This rule is nonsense. On a modern system, that’s a LOT of swap, most people prefer that their systems never swap. You don’t want your system
to ever run out of RAM+swap, but you usually would rather have enough RAM in the system so it doesn’t need to swap. If you are using a flash device for disk, you probably want no swap partition at all. Use what is appropriate for your needs.
再看看 RHEL 5 推荐的 swap 分区大小:
Swap should equal 2x physical RAM for up to 2 GB of physical RAM, and then an additional 1x physical RAM for any amount above 2 GB, but never less than 32 MB. 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 分区的大小,所以这里参考推荐最小 swap 大小更实际一些:
4GB 或 4GB 以下内存的系统,最小需要 2GB 交换空间;
大于 4GB 而小于 16GB 内存的系统,最小需要 4GB 交换空间;
大于 16GB 而小于 64GB 内存的系统,最小需要 8GB 交换空间;
大于 64GB 而小于 256GB 内存的系统,最小需要 16GB 交换空间。
Many people follow an old rule of thumb that your swap partition should be twice the size of your main system RAM. This rule is nonsense. On a modern system, that’s a LOT of swap, most people prefer that their systems never swap. You don’t want your system
to ever run out of RAM+swap, but you usually would rather have enough RAM in the system so it doesn’t need to swap. If you are using a flash device for disk, you probably want no swap partition at all. Use what is appropriate for your needs.
再看看 RHEL 5 推荐的 swap 分区大小:
Swap should equal 2x physical RAM for up to 2 GB of physical RAM, and then an additional 1x physical RAM for any amount above 2 GB, but never less than 32 MB. 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 分区的大小,所以这里参考推荐最小 swap 大小更实际一些:
4GB 或 4GB 以下内存的系统,最小需要 2GB 交换空间;
大于 4GB 而小于 16GB 内存的系统,最小需要 4GB 交换空间;
大于 16GB 而小于 64GB 内存的系统,最小需要 8GB 交换空间;
大于 64GB 而小于 256GB 内存的系统,最小需要 16GB 交换空间。
相关文章推荐
- 如何在安装Linux之后自己修改Swap分区大小
- 增加Linux系统的swap分区的大小
- Linux系统中增加Swap分区大小(转)
- Linux的swap分区大小的调整
- linux获取目录下文件大小的问题
- 如何在安装Linux之后自己修改Swap分区大小
- linux 文件大小ll和du不一致问题
- linux下Oracle通过设置大内存页解决使用swap分区问题
- Linux下磁盘保留空间的调整,解决df看到的空间和实际磁盘大小不一致的问题
- LINUX中更改SWAP分区大小
- [English]Linux支持最大文件的大小问题
- 增加Linux系统的swap分区的大小
- 如何在安装Linux之后自己修改Swap分区大小
- linux 增加swap分区大小
- linux下Oracle通过设置大内存页解决使用swap分区问题
- Linux的swap分区大小的调整
- 在装完Linux系统之后自己去修改Swap分区的大小(两种方法)
- linux系统增加swap分区大小
- linux嵌入式qt的屏幕旋转与字体大小问题
- Linux下磁盘保留空间的调整,解决df看到的空间和实际磁盘大小不一致的问题