Skip to content

EC2 Instance is Shutting Down Intermittently

0

Dear AWS Support,

We are experiencing an issue where our EC2 instance is not available (not shutdown, status is green) unexpectedly at regular or random intervals. This is impacting our application availability, and we are unable to determine the root cause from our end.

Instance Details:

Instance ID: i-0036a8034c8a4ba4f

Region: ap-southeast-1

Operating System: AlmaLinux

Instance Type: t3.medium

Thanking You.

asked a year ago156 views

3 Answers
0

Based on your description, your EC2 instance appears to be running (status is green) but is not accessible intermittently. This is different from a shutdown scenario, as the instance remains active according to AWS. Here are several potential causes and troubleshooting steps:

  1. Resource constraints: Your t3.medium instance might be experiencing CPU or memory pressure. T3 instances use a CPU credit system, and if you exhaust your CPU credits, performance can be throttled, making your application appear unresponsive even though the instance is technically running.

  2. Application issues: Your application might be crashing or becoming unresponsive while the underlying instance continues to run. This is common when applications run out of memory or encounter unhandled exceptions.

  3. Network configuration: Check your security groups, network ACLs, and VPC settings to ensure they haven't been inadvertently changed.

  4. Operating system issues: The AlmaLinux OS might be experiencing issues that make it unresponsive while still appearing to be running from AWS's perspective.

Troubleshooting steps:

  1. Monitor resource usage: Set up CloudWatch alarms to monitor CPU, memory, and disk utilization to identify potential resource constraints.

  2. Check system logs: Examine system logs for error messages or warnings that might indicate the root cause.

  3. Implement proper logging: Ensure your application has comprehensive error logging to capture any issues.

  4. Consider using a process manager: Tools like Supervisor or systemd can automatically restart your application if it crashes.

  5. Enable detailed monitoring: Temporarily enable detailed monitoring in the EC2 console to get more granular metrics during periods of unavailability.

  6. Check the "State transition message" for your instance in the EC2 console if it does actually stop at any point.

If these steps don't resolve the issue, you might want to consider:

  1. Upgrading to a larger instance type with more resources
  2. Implementing an architecture with multiple instances behind a load balancer
  3. Using an auto-scaling group to improve reliability
    Sources
    EC2 stops running intermittently | AWS re:Post
    Instance or Server keeps shutting down | AWS re:Post
    EC2 suddenly gets online and offline randomly | AWS re:Post

answered a year ago

0

Check you EC2 metrics in CloudWatch, I think you have reach the t3 burst limit and therefore the EC2 cannot serve further requests making your EC2 'not available'. You can change your instance type to m5 or c5 depending om your need and the issue might resolve. You might also need to change the instance size from medium to large depending on CPU consumption.

EXPERT

answered a year ago

0

Troubleshoot:

Use CloudWatch to check CPU, Disk and Memory (configure CloudWatch Agent). Since you use t3.medium (a burstable instance), monitor CPU credit balance. If it drops too low, performance can be affected without the instance being marked as unhealthy. Docs: [https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/burstable-credits-baseline-concepts.html]

CloudTrail

Events like: StopInstances, RebootInstances, ModifyInstanceAttribute, TerminateInstances, or CreateImage

Filter by: Resource name: your EC2 instance ID

Docs: [https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-insights.html] [https://repost.aws/knowledge-center/ec2-unexpected-shutdown]

answered a year 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.