When I was building Vue files on a fresh AWS LightSail Machine, the SSH connection would freeze, and the building would result in a killed status. Why? It comes to me that, the memory is too small (1GB) and it gets killed for OOM. But why not swap?
Create a new swap file. By running the following commands, it would create a 8G swap file.
sudo cp /etc/fstab /etc/fstab.bak echo'/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
Ask the system to use swap less frequently.
1 2 3 4
sudo sysctl vm.swappiness=10 echo'vm.swappiness=10' | sudo tee -a /etc/sysctl.conf sudo sysctl vm.vfs_cache_pressure=50 echo'vm.vfs_cache_pressure=50' | sudo tee -a /etc/sysctl.conf