- Newest
- Most votes
- Most comments
Based on the information provided, it appears you're experiencing intermittent 504 Gateway Time-out errors with your AWS Lightsail load balancer. This issue can occur due to various reasons, and here are some steps you can take to troubleshoot and potentially resolve the problem:
-
Check instance resources: Monitor the CPU and memory usage of your instances when the problem occurs. Lightsail instances have a burst capacity for CPU usage, and once this is exhausted, performance can drop, potentially causing timeouts. Consider upgrading your instance plan if you're consistently hitting resource limits.
-
Verify application status: Ensure that your WordPress application is running correctly on both instances. Use the command "sudo netstat -tlnp" to check if the web server is listening on the correct ports (typically 80 and 443).
-
Review load balancer health checks: Make sure your instances are passing the load balancer's health checks. If they're failing, the load balancer might not be able to route traffic properly.
-
Check firewall settings: Verify that your instances' firewall rules allow inbound traffic on ports 80 and 443 from the load balancer.
-
Examine WordPress and web server logs: Look for any error messages or unusual activity that might be causing the application to hang or timeout.
-
Consider connection draining: If you're making changes to your instances, enable connection draining on your load balancer to allow in-flight requests to complete before removing an instance.
-
SSL certificate: Ensure your SSL certificate on the load balancer is up-to-date and properly configured.
-
Load balancer capacity: If you're experiencing high traffic, consider checking if you've reached the limits of your load balancer and if you need to scale up.
If the issue persists after trying these steps, you may need to contact AWS Support for further assistance. They can help you dive deeper into the load balancer logs and configurations to identify any underlying issues.
Sources
AWS Lightsail Gateway Timeout/Site unreachable | AWS re:Post
Troubleshoot a Classic Load Balancer: Response code metrics - Elastic Load Balancing
Troubleshoot Lightsail load balancer issues - Amazon Lightsail
Relevant content
- asked 9 months ago
- asked 3 years ago

Hello - thank you so much for your review of this issue. I have gone through each note, and the only one I cannot solve for is #3 - health check. It says that SSL traffic is taking too long to respond but I have an active and properly installed SSL cert on the load balancer. Both instances/sites work behind the load balancer. How do I reach AWS support?