FYI: a instância t2.micro da AWS é muito pequena. Use pelo menos a t2.small

Also, how big was the swapfile you created?