Improving load balancer performance#2491
Conversation
IPVS module used for swarm load balancer had a performance issue under a high load situation. conn_reuse_mode=0 sysctl variable can be set to handle the high load situation by reusing existing connection entries in the IPVS table. Under a high load, IPVS module was dropping tcp SYN packets whenever a port reuse is detected with a connection in TIME_WAIT status forcing clients to re-initiate tcp connections after request timeout events. By setting conn_reuse_mode=0, IPVS module avoids special handling of existing entries in the IPVS connection table. Along with expire_nodest_conn=1, swarm load balancer can handle a high load of requests and forward connections to newly joining backend services. Signed-off-by: Andrew Kim <[email protected]>
|
thanks for running the tests and contributing ! Had a few questions -
|
|
This fix resolved the same issue for me. My findings here: moby/moby#35082 (comment) Happy to help in any way to move this forward! |
|
@arkodg do you think this fix is likely to be introduced at this layer? Trying to understand if we should add scripting to our deployment that adds this after every docker stack deploy: ...or whether we should wait for a fix here. Any guidance would be much appreciated! |
|
@geekdave Once your stack is running, consecutive docker stack deploy is unnecessary since your load balancer sandbox will be re-used throughout the lifetime of your docker stack. |
|
Thanks for this, @ahjumma ! We have some tooling that performs an initial stack deploy on fresh machines. I'm considering adding some scripting that waits in a loop until the |
|
👋 In kube-proxy we set:
expire_nodest_conn is required to avoid blackholing traffic to existing destinations after removing the RealServer (RST on next packet to backend for TCP, ICMP destination unreachable for UDP) expire_quiescent_template is great when you set weight to 0 to avoid creating new connections to a real server with weight 0 conn_reuse_mode is great for performances: if you set it to 1, a new connection reusing the same 5 tuples will get its first packet dropped, which means the new connection will wait for 1s to retry. |
Hi @arkodg. It does seem net.ipv4.vs.expire_quiescent_template=1 would be also helpful. Regarding your concern raised by possible problematic behaviours of net.ipv4.vs.conn_reuse_mode=0, net.ipv4.vs.expire_nodest_conn=1 is what allows by-passing the problem. For the second question, what's the earliest linux kernel that Docker Swarm needs to support? |
Further improving load balancer performance by expiring connections to servers with weights set to 0. Signed-off-by: Andrew Kim <[email protected]>
|
can you ptal as well @lbernail |
|
will look into it soon. |
selansen
left a comment
There was a problem hiding this comment.
Went through entire discussion . Looks good to me.
full diff: moby/libnetwork@feeff4f...6659f7f includes: - moby/libnetwork#2317 Allow bridge net driver to skip IPv4 configuration of bridge interface - adds support for a `com.docker.network.bridge.inhibit_ipv4` label/configuration - addresses moby#37430 Prevent bridge network driver from setting IPv4 address on bridge interface - moby/libnetwork#2454 Support for com.docker.network.host_ipv4 driver label - addresses moby#30053 Unable to choose outbound (external) IP for containers - moby/libnetwork#2491 Improving load balancer performance - addresses moby#35082 [SWARM] Very poor performance for ingress network with lots of parallel requests Signed-off-by: Sebastiaan van Stijn <[email protected]>
|
I did the same steps but the ingress LB still low. Did I missed any steps Do I have to restart server!? |
relates to moby#35082, moby/libnetwork#2491 Previously, values for expire_quiescent_template, conn_reuse_mode, and expire_nodest_conn were set only system-wide. Also apply them for new lb_* and ingress_sbox sandboxes, so they are appropriately propagated Signed-off-by: Ryan Barry [email protected] Signed-off-by: Ryan Barry <[email protected]>
relates to moby#35082, moby/libnetwork#2491 Previously, values for expire_quiescent_template, conn_reuse_mode, and expire_nodest_conn were set only system-wide. Also apply them for new lb_* and ingress_sbox sandboxes, so they are appropriately propagated Signed-off-by: Ryan Barry <[email protected]>
relates to moby#35082, moby/libnetwork#2491 Previously, values for expire_quiescent_template, conn_reuse_mode, and expire_nodest_conn were set only system-wide. Also apply them for new lb_* and ingress_sbox sandboxes, so they are appropriately propagated Signed-off-by: Ryan Barry <[email protected]>
Pull moby/moby#43146 and moby/moby#43670 into 20.10 relates to #35082, moby#2491 Previously, values for expire_quiescent_template, conn_reuse_mode, and expire_nodest_conn were set only system-wide. Also apply them for new lb_* and ingress_sbox sandboxes, so they are appropriately propagated Signed-off-by: Ryan Barry <[email protected]>
Pull moby/moby#43146 and moby/moby#43670 into 20.10 relates to #35082, moby#2491 Previously, values for expire_quiescent_template, conn_reuse_mode, and expire_nodest_conn were set only system-wide. Also apply them for new lb_* and ingress_sbox sandboxes, so they are appropriately propagated Signed-off-by: Ryan Barry <[email protected]>
Pull moby/moby#43146 and moby/moby#43670 into 20.10 relates to #35082, moby#2491 Previously, values for expire_quiescent_template, conn_reuse_mode, and expire_nodest_conn were set only system-wide. Also apply them for new lb_* and ingress_sbox sandboxes, so they are appropriately propagated Signed-off-by: Ryan Barry <[email protected]>
Pull moby/moby#43146 and moby/moby#43670 into 20.10 relates to #35082, moby#2491 Previously, values for expire_quiescent_template, conn_reuse_mode, and expire_nodest_conn were set only system-wide. Also apply them for new lb_* and ingress_sbox sandboxes, so they are appropriately propagated Signed-off-by: Ryan Barry <[email protected]> Co-authored-by: Bjorn Neergaard <[email protected]>
TL;DR
Updates to improve load balancer performance at a high load scenario.
Resolves moby/moby#35082
Detailed explanation is provided at moby/moby#35082 (comment)