Created
April 18, 2016 17:22
-
-
Save katopz/07ff91bb14cd88d330aaed2c448ad156 to your computer and use it in GitHub Desktop.
Setup Ubuntu paging and swap file.
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
# https://help.ubuntu.com/community/CronHowto | |
# create script in daily cron folder | |
nano /etc/cron.hourly/free-mem.sh | |
# insert below line | |
# http://www.upubuntu.com/2013/01/how-to-free-up-unused-memory-in.html | |
# Free Up Unused Memory | |
sudo sysctl -w vm.drop_caches=3 | |
# page cache, inodes, and dentries | |
sudo sync && echo 3 | sudo tee /proc/sys/vm/drop_caches |
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
# Create a Swap File | |
# https://www.digitalocean.com/community/tutorials/how-to-add-swap-on-ubuntu-14-04 | |
sudo fallocate -l 4G /swapfile | |
ls -lh /swapfile | |
sudo chmod 600 /swapfile | |
ls -lh /swapfile | |
sudo mkswap /swapfile | |
sudo swapon /swapfile | |
sudo swapon -s | |
free -m |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment