Oracle Database 对 SWAP 的建议
- Between 1 GB and 2 GB: 1.5 times the size of the RAM
- Between 2 GB and 16 GB: Equal to the size of the RAM
- More than 16 GB: 16 GB
Note: If you enable HugePages for your Linux servers, then you should deduct the memory allocated to HugePages from the available RAM before calculating swap space.
因为大页不能被 SWAP。这也是为什么开启大页后可以降低 SWAP 交换的原因。
RedHat 对 SWAP 的建议
Amount of RAM in the system | Recommended swap space | Recommended swap space if allowing for hibernation |
<= 2 GB | 2 times the amount of RAM | 3 times the amount of RAM |
> 2 GB – 8 GB | Equal to the amount of RAM | 2 times the amount of RAM |
> 8 GB – 64 GB | At least 4 GB | 1.5 times the amount of RAM |
> 64 GB | At least 4 GB | Hibernation not recommended |