Why my EC2 instance frozen?

0

My t2.micro instance becomes inaccessible when I run two processes, each loads about 112 MiB of data (plus some metadata overhead). The Instance state is still "Running". But I cannot ssh to it, neither can I send requests to it anymore. I can reboot my instance and ssh to it again, but running the two processes with those data will freeze it again.

I suspect that the two processes consume all memory in my instance. But the behavior is strange---I would expect the two processes to OOM and crash, rather than the instance freezes. In addition, the last report of free -m command (which is run every second until the terminal is disconnected from the instance) shows memory remains: total used free shared buff/cache available Mem: 949 377 377 3 194 438 Swap: 0 0 0

What could cause this problem?

Chi
asked 9 months ago198 views
2 Answers
1

I'd suggest you to setup CloudWatch monitoring to observe CPU, memory metrics before launching those two processes.

Once instance freezes, check cloudwatch metric and see where the resources limits are being hit. You might need to consider an instance of higher configuration or two instances of t2.micro and let only one process run on each.

See Cloudwatch Monitoring for more details.

profile pictureAWS
EXPERT
answered 9 months ago
1

This usually happens when the instances memory is maxed out.

I have seen this several times and the fix is to upgrade to an instance type with more RAM.

profile picture
EXPERT
answered 9 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions