1. 程式人生 > >Troubleshoot HTTP 504 Errors While Using Classic Load Balancers

Troubleshoot HTTP 504 Errors While Using Classic Load Balancers

An HTTP 504 error is a HTTP status code that indicates a gateway or proxy has timed out. When troubleshooting, investigate the following:

Check your load balancer’s idle timeout, and then modify if necessary

The most common reason for a load balancer to return HTTP 504 errors is that a corresponding backend instance did not respond to the request within the currently configured idle timeout. By default, the idle timeout for Classic Load Balancer is 60 seconds.

If CloudWatch metrics are enabled, check CloudWatch metrics for your load balancer. If latency data points are equal to your currently configured load balancer timeout value, and there are data points in the HTTPCode_ELB_5XX metric, then at least one request has timed out.

To resolve this, either modify the idle timeout for your load balancer so that the HTTP request will be completed within the idle timeout period, or tune your application to respond more quickly.

Make sure that your backend instances keep connections open

If a backend instance closes a TCP connection to the load balancer before the load balancer has reached its idle timeout value, the load balancer might not be able to fulfill the request, generating an HTTP 504 error.

To resolve this, enable keep-alive settings on your backend instances, and set the keep-alive timeout to a value greater than the load balancer’s idle timeout.

(Apache only) Disable TCP_DEFER_ACCEPT

When TCP_DEFER_ACCEPT is enabled for Apache backend instances, the load balancer initiates a connection by sending a SYN to the backend instance. The backend instance then responds with a SYN-ACK, and the load balancer sends an empty ACK to the backend instance.

Because the last ACK is empty, the back end does not accept the ACK, and instead resends a SYN-ACK to the load balancer. This can result in a subsequent SYN retry timeout. When the backend instance closes the connection without sending a FIN or RST to the load balancer, the load balancer considers the connection to be established even though it is not. Then when the load balancer sends requests through this TCP connection, the back end responds with an RST, generating a 504 error.

To resolve this, set both AcceptFilter http and AcceptFilter https to none.

(Apache only) Disable the event MPM, and optimally configure the prefork and worker MPMs

The event MPM should not be used on backend instances that are registered to a load balancer, because the Apache backend dynamically closes connections, which results in HTTP 504 errors being sent to the clients.

For optimal performance when using the prefork and worker MPMs, and presuming the load balancer is configured with a 60-second idle timeout, use these values:

相關推薦

Troubleshoot HTTP 504 Errors While Using Classic Load Balancers

An HTTP 504 error is a HTTP status code that indicates a gateway or proxy has timed out. When troubleshooting, investigate the following:

Troubleshoot HTTP 503 Errors While Using Classic Load Balancers

To see the number of healthy back-end instances behind your load balancer, check the HealthyHostCount and UnHealthyHostCount metrics in CloudWa

Troubleshoot HTTP 5xx Errors when using Elastic Load Balancing

The resolutions for HTTP 5XX vary. See the following pages for more information: HTTP 502 (Bad Gateway) HTTP 502 errors

Troubleshoot HTTP 307 Errors in Amazon S3

After you create an Amazon S3 bucket, it can take up to 24 hours for the bucket name to propagate across all AWS Regions. During this time, you

Troubleshoot HTTP 5xx Errors from Amazon S3

Enable a retry mechanism in the application making requests Because of the distributed nature of Amazon S3, requests that return 500

Resolve HTTP 504 Errors from CloudFront

Amazon Web Services is Hiring. Amazon Web Services (AWS) is a dynamic, growing business unit within Amazon.com. We are currently hiring So

Configure, Update, and Verify Health Checks for Classic Load Balancers

Elastic Load Balancing health checks automatically connect to backend instances to make sure they're reachable by your load balancer. You can u

Troubleshoot Classic Load Balancer Stickiness

Note: If there is no AWSELB cookie in the response, then there is no stickiness between the client and the backend instance. 2.    I

Load Balancer HTTP 502 Errors

3. Check the ELB access log for duplicate HTTP 502 errors. 502 errors for both elb_status_code and backend_status_code indicate that there is a

Troubleshoot and Fix Failing Classic Load Balancer Health Checks

Amazon Web Services is Hiring. Amazon Web Services (AWS) is a dynamic, growing business unit within Amazon.com. We are currently hiring So

SpaceVim中neomake報錯 Error while trying to load a compilation database

inux cpp turn 沒有 spa without json data mpi 回家裝上archlinux,突發奇想裝個SpaceVim寫題 安裝配置一路可以說是沒有太大問題 最後在寫題時出現如下問題 Error while trying to load a comp

How to fix Error: listen EADDRINUSE while using nodejs

highlight nod node row light end eat test event If I run a server with the port 80, and I try to use xmlHTTPrequest i get this error: Err

攝像頭程式設計大全 原始碼 c http //tmsoft lsxy com/index php load read i

分享一下我老師大神的人工智慧教程!零基礎,通俗易懂!http://blog.csdn.net/jiangjunshow 也歡迎大家轉載本篇文章。分享知識,造福人民,實現我們中華民族偉大復興!        

Ask HN: Maintain zero knowledge while using IP logs for attack mitigation

I've got a service I'd like to put out for public use, but I need to protect it from attacks. Typically I'd use fail2ban and read the IPs from the logs for

Handle HTTP Request Errors in Go @ Alex Pliutau's Blog

In this short post I want to discuss handling HTTP request errors in Go. I see people write code and they believe to be handling errors when mak

Errors while building APK. You can find the errors in the 'Messages' view.

最近在用Android Studio打包簽名apk時遇到了一個問題,經過查詢資料,順利解決。 問題一:Messages報錯如下: Error:Execution failed for task ':app:lintVitalRelease'. >

AndroidStudio打包apk出現的一些問題Lint found fatal errors while assembling a release target.

今天用AndroidStudio打Realse包時遇到如下的問題: 解決方法: 在app的build.gradle裡的android{}中新增如下程式碼,然後再次執行打包。例如: lintOp

Ensure Lifecycle Actions Complete Successfully While Using AWS CodeDeploy

If lifecycle hooks associated with deployment groups that have deleted applications are still active (usually because an application was delet

Log Client Information For TCP/SSL Traffic To An Apache Classic Load Balancer

Amazon Web Services is Hiring. Amazon Web Services (AWS) is a dynamic, growing business unit within Amazon.com. We are currently hiring So

Application Load Balancers Now Support Multiple TLS Certificates With Smart Selection Using SNI

Today we’re launching support for multiple TLS/SSL certificates on Application Load Balancers (ALB) using Server Name Indication (SNI). You can no