SWAPFILE saved my server - composer memory limit

Gespeichert von nedab am Fr., 22.05.2020 - 10:29

My server is heavily used in times of corona. Therefore I had to adjust a lot of settings in order to make the server work properly again.

One of these settings regards my composer script. That php script pulls the latest update for this site and is needed for a smooth administration. Although I read a very interesting tip: run composer locally and commit changes to the production server. But thats a thing for another server to try since I could not find good sources on this just quickly.

For now I followed these instructions as root: https://linuxize.com/post/how-to-add-swap-space-on-debian-9/

swapon --show

fallocate -l 2G /swapfile

chmod 600 /swapfile

mkswap /swapfile

swapon /swapfile

nvim /etc/fstab

"/swapfile swap swap defaults 0 0"


And after doing this free -m shows swap memory and my composer script is running properly again.

For now I am happy again and my little server can operate in good order again.