| 名称 | 504 Gateway Timeout |
|---|---|
| 作用 | 上游处理超时 |
| 规范 | RFC 9110 §15.6.5 |
| 常见配置 | Nginx proxy_read_timeout;网关 timeout 参数 |
定位慢在哪一段
定位慢在哪一段
# 结合访问日志的 upstream_response_time 对比请求总耗时
awk '{print $7, $upstream_response_time, $request_time}' /var/log/nginx/access.log | sort -k2 -rn | head504 排查优先级:上游是否收到请求(截包/日志)→ 处理为何慢(慢 SQL、外部依赖)→ 超时阈值是否合理。调大超时只是止痛,先找到慢的根因。