我们的 haproxy 负载均衡器打开了数千个与其后端的连接,尽管其设置规定每个服务器实例打开的连接不超过 10 个(见下文)。当我取消注释“option http-server-close”时,后端连接数会下降,但我希望后端连接保持活动状态。
为什么不尊重 maxconn http-keep-alive
?我已验证ss
打开的后端连接处于ESTABLISHED
状态。
defaults
log global
mode http
option http-keep-alive
timeout http-keep-alive 60000
timeout connect 6000
timeout client 60000
timeout server 20000
frontend http_proxy
bind *:80
default_backend backends
backend backends
option prefer-last-server
# option http-server-close
timeout http-keep-alive 1000
server s1 10.0.0.21:8080 maxconn 10
server s2 10.0.0.7:8080 maxconn 10
server s3 10.0.0.22:8080 maxconn 10
server s4 10.0.0.16:8080 maxconn 10