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
已提問 10 個月前檢視次數 223 次
2 個答案
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
專家
已回答 10 個月前
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
專家
已回答 10 個月前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南