Increase Swap size - digitalocean droplet

Set the swap size to 512M and after a while mysql failed to start. Tail the /var/log/mysql/error.log and found that innodb had memory-related error. For now I solved it by increasing the swapfile size.

1. Cannot swapoff since there was not enough memory
2. So I create new swapfile first and use it and then delete the old one and edit the /etc/fstab file

sudo fallocate -l 4G /swapfilenew
sudo mkswap /swapfilenew
sudo swapon /swapfilenew
sudo swapoff /swapfile # < delete old swap
sudo rm /swapfile
sudo swapon -s # check to make sure

Edit /etc/fstab to turn on swap when reboot. Change from /swapfile to /swapfilenew

Popular posts from this blog

Make keyboard on PC behave like Mac

Put on your blog

Scuttle Bookmark