ALB 502 Error - Conflicting Solution Documentation

0

Hi Guys,

I'm running a couple accounts that each have an ALB in front of a single Ubuntu 18.04 EC2 instance running Apache 2.4.38 & PHP7.3-FPM.

I'm getting random ELB_502 errors that I found via the ALB logs. These errors are not displayed in the target's logs.

I have followed the directions on the following knowledge center article https://aws.amazon.com/premiumsupport/knowledge-center/apache-backend-elb/

According to the above:

  1. the Application timeout must be greater than the ELB idle timeout.
  2. Keep-Alive timeout must be greater than the Application Timeout.

However, this additional document indicates the Keep-Alive timeout must be shorter than the ELB idle timeout: https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-troubleshooting.html#http-502-issues

Specifically: "The target closed the connection with a TCP RST or a TCP FIN while the load balancer had an outstanding request to the target. Check whether the keep-alive duration of the target is shorter than the idle timeout value of the load balancer."

My setup:
ELB idle timeout: 60s (default)
Application timeout: 120s
Keep-Alive timeout: 130s

I don't see how I can adjust the Keep-Alive timeout as per the second document without failing to meet the first documents suggestion?

ubbe
已提問 5 年前檢視次數 1206 次
1 個回答
0

Don't use Apache's event MPM module when behind a ALB/ELB. It dynamically closes connections.

Switched to worker MPM.

Solved.

Edited by: ubbe on Sep 16, 2019 11:53 AM

ubbe
已回答 5 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南