大网数据广告活动
服务器运维问答

Nginx Ingress 504 timeout - EKS with ELB connected to nginx ingress

· 52CE 我爱测

We are using a NLB in AWS connected to our EKS cluster via a nginx ingress controller. Some of our requests get a random 504 gateway timeout. We think we debugged the problem to our nginx ingress. Based on some Stackoverflow reco…

问题原文

原帖链接 · Siva Vg · CC BY-SA 4.0

We are using a NLB in AWS connected to our EKS cluster via a nginx ingress controller. Some of our requests get a random 504 gateway timeout.

We think we debugged the problem to our nginx ingress. Based on some Stackoverflow recommendations we played around with Connection headers.

  1. We set Connection "close" this had no effect
  2. We set Connection "keep-alive" again no effect

We also noticed another behavior with our proxy_read_timeout when it was 60 seconds our request from the browser would be fulfilled at 60.xx seconds. When we reduced it to 30 it became 30.xx, 20 became 20.xx. We went to 1 but still get random 504 gateway timeouts and do not understand why proxy_read_timeout has this behavior in our environment.

We want to understand what is the effect of proxy_read_timeout and why do we get above behavior? Also is there a way to set Connection to "" on our nginx ingress (we are not able to do this via nginx.ingress.kubernetes.io/connection-proxy-header: "")

Thanks in advance!

已采纳解答

原帖链接 · J. Koncel · CC BY-SA 4.0

We think our issue was related to this:

https://docs.aws.amazon.com/elasticloadbalancing/latest/network/load-balancer-troubleshooting.html#loopback-timeout

We're using an internal nlb with our nginx ingress controller, with targets registered by instance ID. We found that the 504 timeouts and the X second waits were only occurring on applications that were sharing a node with one of our ingress controller replicas. We used a combination of nodeSelectors, labels, taints, and tolerations to force the ingress controllers onto their own node, and it appears to have eliminated the timeouts.

We also changed our externalTrafficPolicy setting to Local.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2019-04-15)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。