gpt4 book ai didi

nginx - Nginx 上的 send_timeout 选项有什么作用?

转载 作者:行者123 更新时间:2023-12-03 15:57:47 32 4
gpt4 key购买 nike

设置低(10s)或高(60s)有什么优点和缺点,它与keepalive_timeout有何不同? ?

最佳答案

来自 the docs :

Syntax: keepalive_timeout timeout [header_timeout];
Default: keepalive_timeout 75s;
Context: http, server, location

The first parameter sets a timeout during which a keep-alive client connection will stay open on the server side. The zero value disables keep-alive client connections.

The optional second parameter sets a value in the “Keep-Alive: timeout=time” response header field. Two parameters may differ.

The “Keep-Alive: timeout=time” header field is recognized by Mozilla and Konqueror. MSIE closes keep-alive connections by itself in about 60 seconds.



Syntax: send_timeout time;
Default: send_timeout 60s;
Context: http, server, location

Sets a timeout for transmitting a response to the client. The timeout is set only between two successive write operations, not for the transmission of the whole response. If the client does not receive anything within this time, the connection is closed.



所以当使用 keepalive_timeout ,浏览器不必建立多个连接,而是使用已经建立的连接。这控制了保持事件/打开的时间。

我建议如果您设置 send_timeout比您的 Web 服务器小,它将快速关闭连接,这将为连接主机提供更多可用的整体连接。

这些参数很可能只与高流量网络服务器相关,两者都支持相同的目标:更少的连接和更高效的请求处理,或者将所有请求放入一个连接(保持事件)或快速关闭连接以处理更多请求(发送超时) )。

关于nginx - Nginx 上的 send_timeout 选项有什么作用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48149765/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com