我已经Keepalived
配置了LVS
在四个 Nginx Web 服务器之间分散负载(RR 模式,无持久连接)。我打算启用快闪记忆体然而,似乎SPDY
每个主机都设置了一个 TCP 连接,因此当一个 Web 节点从池中删除时,客户端会尝试通过原始连接发送进一步的请求,但负载均衡器无法将现有连接移动到新服务器上,因此该客户端的所有 Web 请求都会超时。
有没有办法强制负载均衡器关闭与故障服务器的所有连接,或者可能有其他解决方案?
答案1
尝试打开持久性,然后 expire_quiescent_template
123 expire_quiescent_template - BOOLEAN
124 0 - disabled (default)
125 not 0 - enabled
126
127 When set to a non-zero value, the load balancer will expire
128 persistent templates when the destination server is quiescent.
129 This may be useful, when a user makes a destination server
130 quiescent by setting its weight to 0 and it is desired that
131 subsequent otherwise persistent connections are sent to a
132 different destination server. By default new persistent
133 connections are allowed to quiescent destination servers.
134
135 If this feature is enabled, the load balancer will expire the
136 persistence template if it is to be used to schedule a new
137 connection and the destination server is quiescent.
http://www.mjmwired.net/kernel/Documentation/networking/ipvs-sysctl.txt