Procházet zdrojové kódy

Improving load balancer performance

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 <taeyeonkim90@gmail.com>
Andrew Kim před 5 roky
rodič
revize
8899d916c0
1 změnil soubory, kde provedl 3 přidání a 0 odebrání
  1. 3 0
      libnetwork/osl/namespace_linux.go

+ 3 - 0
libnetwork/osl/namespace_linux.go

@@ -38,6 +38,9 @@ var (
 	gpmChan            = make(chan chan struct{})
 	prefix             = defaultPrefix
 	loadBalancerConfig = map[string]*kernel.OSValue{
+		// disables any special handling on port reuse of existing IPVS connection table entries
+		// more info: https://github.com/torvalds/linux/blob/master/Documentation/networking/ipvs-sysctl.txt#L25:1
+		"net.ipv4.vs.conn_reuse_mode": {Value: "0", CheckFn: nil},
 		// expires connection from the IPVS connection table when the backend is not available
 		// more info: https://github.com/torvalds/linux/blob/master/Documentation/networking/ipvs-sysctl.txt#L126:1
 		"net.ipv4.vs.expire_nodest_conn": {Value: "1", CheckFn: nil},