dd if=/dev/zero of=/var/swapfile bs=1024 count=1024000 mkswap /var/swapfile swapon /var/swapfile chmod -R 0600 /var/swapfile sysctl vm.swappiness=10 sysctl vm.vfs_cache_pressure=50文件修改:
vi /etc/fstab /var/swapfile swap swap defaults 0 0 vi /etc/sysctl.conf vm.swappiness=10 vm.vfs_cache_pressure=50