Created
February 23, 2018 13:02
-
-
Save cybersholt/23b0f61ea0580a688c29a707bf75145a to your computer and use it in GitHub Desktop.
Swap for CentOS 7
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Creates SWAP on the server | |
# One of the things that I have lerned is that this kind of servers need swap. | |
# With these fast SSD disks you gain kind of "pseudo-ram"!!!. | |
sudo dd if=/dev/zero of=/swapfile bs=1G count=1 | |
sudo chmod 600 /swapfile | |
sudo mkswap /swapfile | |
sudo swapon /swapfile | |
sudo echo "/swapfile none swap sw 0 0" >> /etc/fstab | |
sudo sysctl vm.swappiness=10 | |
sudo echo "vm.swappiness=10" >> /etc/sysctl.conf | |
sudo sysctl vm.vfs_cache_pressure=50 | |
sudo echo "vm.vfs_cache_pressure=50" >> /etc/sysctl.conf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment