http://www.prowebdev.us/2012/05/amazon-ec2-linux-micro-swap-space.html
MySQL 과 관련된 문제는 아마도 t2.nano의 메모리 부족으로 발생하는 것 같다. 우선은 링크된 곳과 같은 방법으로 해결해보고자 함. 저 명령어의 의미는 정확히는 모르겠으나 스왑 메모리를 늘려서 이를 이용하는 것으로 생각됨. 링크가 깨질 때를 위해서 아래에 남겨둠.
Amazon EC2 Linux Micro instances have only 613MB of memory and can cause MySQL to crash every now and then. There is no default SWAP space for micro instances, so you may need to setup a swap space for your micro instance.
Steps below show how to make a swap space for your Micro instance:
- Run dd if=/dev/zero of=/swapfile bs=1M count=1024
- Run mkswap /swapfile
- Run swapon /swapfile
- Add this line /swapfile swap swap defaults 0 0 to /etc/fstab
Step 4 is needed if you would like to automatically enable swap file after each reboot.Some useful command related to SWAP space: