哪个是更好的配置/优化:明确限制keepalive_timeout或允许 Nginx 自行终止保活连接?
我看到了关于keepalive_timeoutNginx 指令的两个相互矛盾的建议。它们如下:
# How long to allow each connection to stay idle; longer values are better
# for each individual client, particularly for SSL, but means that worker
# connections are tied up longer. (Default: 65)
keepalive_timeout 20;
Run Code Online (Sandbox Code Playgroud)
和
# You should remove keepalive_timeout from your formula.
# Nginx closes keepalive connections when the
# worker_connections limit is reached.
Run Code Online (Sandbox Code Playgroud)
该Nginx的 文档为keepalive_timeout没有提及自动查杀,而我只看到这一建议一次,但它令我着迷。
该服务器专门为TLS 安全连接提供服务,所有未加密的连接都会立即重新路由到https://相同 URL的版本。
VBa*_*art 12
当达到 worker_connections 限制时,Nginx 关闭 keepalive 连接。
确实如此。
ngx_drain_connections();ngx_reusable_connection(c, 1);| 归档时间: |
|
| 查看次数: |
25962 次 |
| 最近记录: |