Skip to content

Instantly share code, notes, and snippets.

@orlando
Created July 11, 2016 17:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save orlando/762415d87574a4866b7c60b507e7b36d to your computer and use it in GitHub Desktop.
Save orlando/762415d87574a4866b7c60b507e7b36d to your computer and use it in GitHub Desktop.
Habilitar memoria swap en Ubuntu.

Memoria Swap en Ubuntu

Estos son los pasos a seguir para habilitar memoria swap en tu VPS corriendo Ubuntu, probablemente esto sirva para otros VPS

echo "Reemplazar 4G por el doble de memoria ram del sistema, ejemplo si tengo 1gb de ram, entonces colocar 2G)"
sudo fallocate -l 4G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile

echo "Para hacerlo permanente, modificar el archivo /etc/fstab y agregar"
echo "/swapfile   none    swap    sw    0   0"
echo "al final de archivo"
sudo vi /etc/fstab
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment