Skip to content

EC2 suddenly gets online and offline randomly

1

Starting this morning, my EC2 server that hosts a website started to behave strangely. The connection was on and off randomly. My instance id is i-0fb7681ef7b9c20de. No changes were made to the server. Also, the systems manager only worked on and off. Sometimes, I can connect to it without an issue. Sometims, just didn't work. Tried reboot and everything I can think of. Still had the problem now. Any advice is appreciated.

asked 2 years ago302 views

2 Answers
0

Hello,

Questions:

  1. Does the connection simply hang when you try to initiate a connection?

  2. Would you kindly post the system logs, if possible.

  3. Have you tried to ping <EC2-PUBLIC-IP> from another local machine? Or try to SSH from another local machine to the EC2?

  4. Have you tried enabling 'detailed monitoring'? There is an additional cost for this, I would suggest you turn it on when you are unable to connect to the instance and attempt several times to make a connection and then disable 'detailed monitoring' off again. You may enable detailed monitoring when the instance is running or stopped.

    To enable detailed monitoring > Click on the check box next to the EC2 > Actions > Monitor and Troubleshoot > Manage detailed monitoring > Enable.

  5. Any screenshots would be helpful, if possible.

Enter image description here Source: https://blog.jineshkumar.com/enabling-or-disabling-detailed-monitoring-for-amazon-ec2-instances

answered 2 years ago

-2

Based on the symptoms you've described, there could be several potential causes for your EC2 instance's intermittent connectivity issues. Here are some steps you can take to troubleshoot and potentially resolve the problem:

  1. Check Instance Status: Verify that your instance is in a "running" state and that the status checks are passing. Sometimes, underlying hardware issues can cause intermittent connectivity.
  2. Review System Logs: Examine the system logs in the EC2 console for any error messages or warnings that might indicate the root cause of the problem. Look for issues related to resource constraints, service failures, or unexpected shutdowns.
  3. Monitor Resource Usage: Use AWS CloudWatch or other monitoring tools to check if there are any spikes in CPU, memory, or disk usage that could be causing the instance to become unresponsive.
  4. Verify Network Configuration: Ensure that your security groups, network ACLs, and VPC settings are correctly configured and haven't been inadvertently changed.
  5. Check for Service Disruptions: Review the AWS Service Health Dashboard to see if there are any reported issues in your region that might be affecting your instance.
  6. Investigate Application Issues: If you're running a web application, check the application logs for any errors that might be causing the server to become unresponsive.
  7. Consider Instance Recovery: If the problem persists, you might want to try stopping and starting the instance (not just rebooting) to move it to new underlying hardware.
  8. Elastic IP: If you're not using an Elastic IP, consider associating one with your instance to maintain a consistent public IP address.

If these steps don't resolve the issue, and you continue to experience intermittent connectivity, it may be worth contacting AWS Support for further assistance. They can help investigate if there are any underlying infrastructure issues affecting your instance.

Sources
EC2 Suddenly stopped responding | AWS re:Post
Cannot connect to myec2 through ssh suddenly fronm today | AWS re:Post
Suddenly I can't connect to my ec2 server | AWS re:Post
Ec2 instance became repeatedly inaccessible despite multiple reboot attempts. | AWS re:Post

answered 2 years ago

EXPERT

reviewed 2 years ago

  • None of the suggestions worked.

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.