Skip to content

EC2 Instance that get ERR_CONNECTION_TIMED_OUT

0

Hello, May EC2 instance worked fine for a while, and suddenly, out of nowhere, the website got a ERR_CONNECTION_TIMED_OUT - and everything seems to run OK on the instance.

I have also just noticed that the RDS connection count is 0. May this be the reason for the "connection timeout," that something went wrong with the RDS connection?

Thanks, Maya

asked a year ago317 views
2 Answers
0

To address the ERR_CONNECTION_TIMED_OUT issue with your EC2 instance:

Check EC2 Health:

Ensure the EC2 instance is running properly and not overloaded. Verify the web server (e.g., Apache, Nginx) is up and running. Network and Security Groups:

Confirm security groups allow traffic on required ports (e.g., HTTP, HTTPS). Check Network ACLs and VPC settings for any blocking rules. RDS Connection:

Ensure the RDS instance is operational and accessible from the EC2 instance. Verify RDS security groups allow connections from the EC2 instance. Check if the database credentials and endpoint settings are correct. Application Logs:

Review logs for errors related to database connections or other issues. Connectivity Tests:

Test database connection using command-line tools (e.g., mysql, psql). Use telnet or nc to check connectivity to the RDS endpoint. Restart Services:

Restart the web server or EC2 instance if needed to resolve issues.

I hope this information is helpful. If it is, please consider accepting the answer so that others can benefit from the clarity when searching for similar questions in the community. Thank you!

AWS
EXPERT
answered a year ago
  • So, if I see in the RDS dashboard, "Current activity 0 Connections," does it indicate that there is some error with the database? For that the "timeout" error?

0

Database Connection Pooling: Ensure that your application's database connection pooling is configured correctly. If the pool is exhausted or not properly managed, it can cause connection timeouts.

RDS Security Group Changes: Verify that the RDS instance's security group rules allow incoming connections from your EC2 instance.

Network Connectivity: Check the network connectivity between your EC2 instance and RDS instance. Ensure that they are in the same VPC or have proper peering/vpn connections.

RDS Maintenance: Check if there are any scheduled or ongoing RDS maintenance activities that might be causing the issue.

Application Logs: Check your application logs for any database-related errors or warnings that might indicate the root cause.

RDS Connection Test: Use a tool like Telnet or MySQL Workbench to test the connection to your RDS instance from your EC2 instance.

EC2 Instance Restart: Restart your EC2 instance to ensure it's not a temporary issue.

RDS Instance Restart: If possible, restart your RDS instance to see if it resolves the issue.

EXPERT
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.