Red Hat 平台的推荐交换大小是多少?
环境
- Red Hat Enterprise Linux 8
- Red Hat Enterprise Linux 7
- Red Hat Enterprise Linux 6
- Red Hat Enterprise Linux 5
- Red Hat OpenStack Platform (all versions)
问题
- If I add several hundred gigabytes of RAM to a system, do I really need several hundred gigabytes of swap space?
- What are the recommended swap size settings for Red Hat Enterprise Linux 5, Red Hat Enterprise Linux 6, Red Hat Enterprise Linux 7, Red Hat Enterprise Linux 8?
- What are the recommended swap size settings for Red Hat OpenStack Platform?
- How much swap should I assign to a virtual guest, is the recommendation different from a normal system?
决议
-
In years past, Red Hat recommended a linear increase to the amount of swap space on a system as the amount of RAM increased. Specifically, the recommendation was that swap space should equal twice the amount of RAM when the system has up to 2 GB of RAM installed, and the amount of RAM plus 2GB when the system has more than 2GB of RAM installed.
-
This advice is no longer practical for modern computers and modern platforms as amounts of installed RAM have increased to multiple terabytes on some systems. The following guidelines are a better way to determine the amount of swap space a system should have:
Red Hat Enterprise Linux 5
Amount of installed RAM | Recomended swap space |
---|---|
4GB or less | 2GB swap space |
4GB - 16GB | 4GB swap space |
16GB - 64GB | 8GB swap space |
64GB - 256GB | 16GB swap space |
Note: A swap space of at least 100GB is recommended for systems with over 140 logical processors.
Red Hat Enterprise Linux 6, Red Hat Enterprise Linux 7, Red Hat Enterprise Linux 8, Red Hat OpenStack Platform (all versions)
Amount of installed RAM | Recommended swap space | Recommended swap space if allowing for hibernation |
---|---|---|
2GB or less | Twice the installed RAM | 3 times the amount of RAM |
> 2GB - 8GB | The same amount of RAM | 2 times the amount of RAM |
> 8GB - 64GB | At least 4GB | 1.5 times the amount of RAM |
> 64GB or more | At least 4GB | Hibernation not recommended |
Note: A swap space of at least 100GB is recommended for systems with over 140 logical processors or over 3TB of RAM.
-
The following items also influence the decision on how much swap space should be allocated:
- Do specific application requirements exist? Applications may have been written with a specific amount of swap space in mind. If this is the case, the system should be set up with the amount of swap that is recommended by the application vendor.
- Do other requirements exist? Workstations and laptops may use hibernation functions that store the RAM contents in the swap area. In this case, the swap space would need to be equal to or greater than the amount of RAM installed in the system to enable hibernation.
- Assigning swap as 'last effort' memory While the block devices hosting swap are generally many times slower than RAM, it is useful to have swap as another layer of memory that's available when needed. In the case of applications with high memory utilization, swap space can allow memory to be swapped out to disk to delay or prevent the termination of applications by the OOM killer.
-
Virtual guests: for virtual guests, the same considerations as for physical systems apply. Also for these, using a bit of swap can influence the behaviour of a process requesting more and more memory, so the process gets slowed down first (leaving time for a sysadmin to manually fix the situation) before eventually also the swap is exhausted and the OOM killer terminates processes. If the memory written by the processes is not exceeding the available swap, the system will just experience a temporary slowdown.
-
Red Hat OpenStack Platform: Red Hat OpenStack Platform Director swap space is configured at install time following the standard RHEL partitioning guidance provided above. To configure swap space for Director deployed overcloud nodes please refer to Solution 4005521.
https://access.redhat.com/solutions/15244
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 地球OL攻略 —— 某应届生求职总结
· 提示词工程——AI应用必不可少的技术
· 字符编码:从基础到乱码解决
· Open-Sora 2.0 重磅开源!
2020-06-28 centos7 netstat命令使用场景 杂记