apisix icon indicating copy to clipboard operation
apisix copied to clipboard

help request: the Read Timeout of Basic Information in upstream

Open michaelh1355 opened this issue 3 years ago • 2 comments

Description

APISIX 的 Upstream配置中这三个参数Connect Timeout、 Send Timeout、Read Timeout 分别配置多少合适? 创建Upstream时默认是6s,当我启用websocket时,发现 Read Timeout 6s会引起client browser报 "websocket closed" image 当Read Timeout 增加到17s,client browser恢复正常,"websocket closed" 消失。请问这是什么原因?当使用websocket时如何正确设置Connect Timeout、 Send Timeout、Read Timeout 的大小?

谢谢!

Environment

  • APISIX version (run apisix version):
  • Operating system (run uname -a):
  • OpenResty / Nginx version (run openresty -V or nginx -V):
  • etcd version, if relevant (run curl http://127.0.0.1:9090/v1/server_info):
  • APISIX Dashboard version, if relevant:
  • Plugin runner version, for issues related to plugin runners:
  • LuaRocks version, for installation issues (run luarocks --version):

michaelh1355 avatar Jul 17 '22 15:07 michaelh1355

@michaelh1355 That depends on the data transmission frequency over the WebSocket connection. If you can make sure the upstream will send some WebSocket frames every N seconds, then a read timeout larger than N is OK. Or if you're not sure it, try to use the WebSocket Ping frame, e.g., the upstream will send a Ping to the downstream every X seconds, then set a read timeout > X.

tokers avatar Jul 18 '22 01:07 tokers

ref: https://github.com/apache/apisix/issues/5440#issuecomment-975759572

Make the timeout time greater than the heart rate

tzssangglass avatar Jul 18 '22 01:07 tzssangglass

This issue has been marked as stale due to 350 days of inactivity. It will be closed in 2 weeks if no further activity occurs. If this issue is still relevant, please simply write any comment. Even if closed, you can still revive the issue at any time or discuss it on the [email protected] list. Thank you for your contributions.

github-actions[bot] avatar Jul 07 '23 10:07 github-actions[bot]

This issue has been closed due to lack of activity. If you think that is incorrect, or the issue requires additional review, you can revive the issue at any time.

github-actions[bot] avatar Jul 22 '23 10:07 github-actions[bot]