AWS EC2 – Troubleshooting Instance Freezes

amazon ec2amazon-web-servicesdockerdocker-composeunexpected-shutdown

I am experiencing sudden freezes in one particular instance.
Here some details of the instance:
Type: t2.micro
Region/av. zone: us-west-2b
OS: amzn-ami-hvm-2018.03.0.20180811-x86_64-gp2 (ami-a0cfeed8)

My this Ec2 instance freezes automatically.

I have docker installed in the instance.
I am new in this field.
don't have an idea from where can I get system or server log that why my ec2 instance continuously freezing, so that I can trace the problem.
Thanks in Advance.

Best Answer

Couple of options:

  1. Use a larger size, e.g. t2.small or t2.medium - if the freezing goes away it may be memory-related.

  2. Examine CPU Credits usage - if it "freezes" when the CPU credits go low you're overloading the instance. Use a larger one.

  3. Examine the OS logs - in /var/log/*. There may be some clues about memory or other problems.

  4. Once it "freezes" go to EC2 -> Instances -> Actions -> Instance Settings -> Get System Log and see if you get any clues there.

Hope that helps :)