Skip to content

Instantly share code, notes, and snippets.

@itelo
Last active May 26, 2016 22:21
Show Gist options
  • Save itelo/34c89ef4f004d605a3b813b9c14c59c9 to your computer and use it in GitHub Desktop.
Save itelo/34c89ef4f004d605a3b813b9c14c59c9 to your computer and use it in GitHub Desktop.
# With the basic (500 MB RAM) you will need a swap with 1 GB to run MEAN.js or
# Gitlab, you can do that following the steps above:
sudo swapon -s
sudo dd if=/dev/zero of=/swapfile bs=1024 count=2048k
sudo mkswap /swapfile
sudo swapon /swapfile
sudo echo '/swapfile none swap sw 0 0' > /etc/fstab
# This sets the system to swap memory only when RAM usage is more than 80%,
# default was swapping when RAM usage was more than 60%, which results in
# most of the services being swapped if you experience a traffic spike.
echo 20 | sudo tee /proc/sys/vm/swappiness
echo vm.swappiness = 20 | sudo tee -a /etc/sysctl.conf
sudo chown root:root /swapfile
sudo chmod 0600 /swapfile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment