FreeBSD交换分区大小的重要性
By admin
- One minute read - 95 words查看交换分区大小:
#swapinfo -m
前天给数据库服务器添加完内存,发现系统运行不太正常,效率比较低下,vmstat 中 faults 的 system call 比较高,有点怀疑是交换分区比物理内存少的缘故(交换分区还是原来的6G内存的大小)。再次温习 手册:
The kernel’s VM paging algorithms are tuned to perform best when the swap partition is at least two times the size of main memory. Configuring too little swap can lead to inefficiencies in the VM page scanning code and might create issues later if more memory is added.
后将交换区增加到物理内存的两倍,虽然效率没有完全恢复,但目前看来还是好了很多。(由于是现有系统,只能通过添加 Swapfiles 的方式增加交换分区,但基于 Swapfiles 方式对性能多少有所损耗)
新系统安装的时候都应该将交换分区设置为物理内存的两倍!On larger systems with multiple SCSI disks (or multiple IDE disks operating on different controllers), it is recommend that a swap is configured on each drive (up to four drives).
来源: