Skip to content

Intermittent loss of access to instance

0

Every so often we are unable to access our instance over webservices or SSH. This forces us to restart the instance, which seems a bit much to do this so often. There are no warnings and according to the console the instance is still operational.

asked 2 years ago180 views

1 Answer
1

The intermittent loss of access to your EC2 instance, despite the console showing it as operational, is a common issue that can have several causes. Here are some potential reasons and steps you can take to diagnose and resolve the problem:

  1. Instance Status Checks: Even if the console shows the instance as operational, it's important to check if all status checks are passing. The "Instance Reachability Check" in particular can fail, indicating connectivity issues.

  2. Resource Utilization: High CPU usage, memory consumption, or disk space limitations can cause the instance to become unresponsive. Monitor these metrics to ensure they're not spiking or reaching capacity limits.

  3. Security Groups and Network ACLs: Verify that your security group rules and Network ACLs are correctly configured to allow inbound traffic on the necessary ports for your web services and SSH.

  4. Instance Type and CPU Credits: If you're using a burstable instance type (like t2 or t3), you might be exhausting your CPU credits, leading to performance degradation. Consider monitoring your CPU credit balance or upgrading to a larger instance type if needed.

  5. Application Issues: The problem could be with the application running on your instance. Check application logs for any errors or unexpected behavior.

  6. System Logs: Examine the system logs for any warnings or errors that might explain the loss of connectivity.

  7. Elastic IP: If you're using an Elastic IP, ensure it's correctly associated with your instance after each restart.

To prevent the need for frequent restarts:

  • Set up detailed monitoring for your instance to catch issues early.
  • Consider using Amazon CloudWatch alarms to alert you of high resource utilization or failed status checks.
  • If the issue persists, you might want to consider using an Auto Scaling group with a load balancer to automatically replace problematic instances.

If none of these steps resolve the issue, you may need to engage AWS support for more in-depth troubleshooting specific to your setup.

Sources
Instance keeps on failing with status check - reachability issue | AWS re:Post
Instance running but can't connect | AWS re:Post
Instance Reachability continously fails | AWS re:Post
I have a problem with ec2 instance. | AWS re:Post

answered 2 years ago

EXPERT

reviewed 2 years 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.