SSD盘上放swap file的注意事项:

SSD盘上放swap file的注意事项:

摘自:http://docs.oracle.com/cd/E52668_01/E54669/html/section_h4v_3yt_tr.html
19.6 SSD Configuration Recommendations for btrfs, ext4, and swap

If you configure swap files or partitions on an SSD, reduce the tendency of the kernel to perform anticipatory writes to swap, which is controlled by the value of the vm.swappiness kernel parameter and displayed as /proc/sys/vm/swappiness. The value of vm.swappiness can be in the range 0 to 100, where a higher value implies a greater propensity to write to swap. The default value is 60. The suggested value when swap has been configured on SSD is 1. You can use the following commands to change the value:

# echo "vm.swappiness = 1" >> /etc/sysctl.conf
# sysctl -p
...
vm.swappiness = 1