【发布时间】:2019-05-04 09:13:44
【问题描述】:
我在 AWS 负载均衡器后面运行 spring 云网关(我理解它是基于 Spring Webflux 构建的),我收到间歇性的 502 错误。经调查,问题似乎与负载均衡器和我的节点之间的连接超时有关。从一些调查看来,底层网络服务器的默认超时时间为 10 秒。我使用以下命令确定了这一点...
time nc -vv 10.10.xx.xxx 5100
Connection to 10.10.xx.xxx 5100 port [tcp/*] succeeded!
real 0m10.009s
user 0m0.000s
sys 0m0.000s
虽然我可以将负载均衡器上的 idleTimeout 设置为低于 10 秒,但感觉效率非常低。如果可能的话,我想保持在 30 秒以上。相反,我想增加 netty 服务器上的连接超时。我试图在我的 application.yml 中设置 server.connection-timeout 属性...
server:
connection-timeout: 75000
也可以通过指定秒...
server:
connection-timeout: 75s
但是当我运行 time 命令查看我的连接持续多长时间时,超时并没有改变,它仍然在 10 秒结束...
time nc -vv 10.10.xx.xxx 5100
Connection to 10.10.xx.xxx 5100 port [tcp/*] succeeded!
real 0m10.009s
user 0m0.000s
sys 0m0.000s
我在这里错过了什么?
【问题讨论】:
标签: spring-webflux spring-cloud-gateway reactor-netty