EC2 instance becoming unresponsive

0

I have an issue where I create a server on EC2 and it will crash after a couple of days.

When it goes down, it becomes totally unresponsive. I'm unable to:

  • Access via SSH (connection just times out)
  • Access any servers running on the port
  • Perform shutdown or reboot via the AWS console
  • Connect to the instance via AWS console

My only option is to terminate and reboot the instance.

The details of the instance are:

  • AMI name: al2023-ami-minimal-2023.1.20230705.0-kernel-6.1-arm64
  • Virtualization type: HVM
  • AZ: eu-west-2c
  • Instance type: t4g.small

When it happens, I get Status check: 1/2 checks passed:

  • System status checks: System reachability check passed
  • Instance status checks: Instance reachability check failed

I am using it to run an application in a Docker container.

已提問 10 個月前檢視次數 920 次
1 個回答
0

This sounds very much like resource exhaustion, your EC2 is running out of something like CPU or memory and becoming unresponsive.

Does the monitoring tab of the AWS Console indicate anything that looks concerning around the time that the instance goes off the air?

The behaviour you're reporting reminds me of this question recently, which was a similar set-up to yours (small-ish instance, running Docker, kept going offline after a short while and had to be rebooted) https://repost.aws/en/questions/QULkwTBPOTQn-Q6cTmltB3nA/can-t-connect-to-my-ec2-instance-with-ssh

It would certainly be worth installing CloudWatch agent to collect more detailed metrics to assist in troubleshooting should this happen again https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Install-CloudWatch-Agent.html

profile picture
專家
Steve_M
已回答 10 個月前
  • Thanks for the response. Looking at the other question and the monitoring dashboard, it does look like this is a possibility. I think the problem is I'm running a memory hungry application in Docker and have no swap file on my 2GB machine.

    I'm going to try enabling a swap file of 4GB before upgrading the instance.

    Thank you

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

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

回答問題指南