Improve xl socat migrations
authorHrvoje Ribicic <riba@google.com>
Thu, 10 Sep 2015 12:12:24 +0000 (12:12 +0000)
committerHrvoje Ribicic <riba@google.com>
Thu, 10 Sep 2015 15:01:20 +0000 (17:01 +0200)
Improve their reliability by allowing socat to reuse an address,
preventing errors if migrations are executed with too narrow a
timespan.

Improve performance by choosing a better blocksize than the default 8k.

Signed-off-by: Hrvoje Ribicic <riba@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>

lib/hypervisor/hv_xen.py
src/Ganeti/Constants.hs

index 4229ba4..440ab96 100644 (file)
@@ -1179,8 +1179,8 @@ class XenHypervisor(hv_base.BaseHypervisor):
       # And try and kill a previous daemon
       XenHypervisor._KillMigrationDaemon(instance)
 
-      listening_arg = "TCP-LISTEN:%d,bind=%s" % (port, target)
-      socat_pid = utils.StartDaemon(["socat", listening_arg,
+      listening_arg = "TCP-LISTEN:%d,bind=%s,reuseaddr" % (port, target)
+      socat_pid = utils.StartDaemon(["socat", "-b524288", listening_arg,
                                      "SYSTEM:'xl migrate-receive'"],
                                      pidfile=pidfile)
 
index 4c226e9..193dc26 100644 (file)
@@ -505,7 +505,7 @@ xenKernel :: String
 xenKernel = AutoConf.xenKernel
 
 xlSocatCmd :: String
-xlSocatCmd = "socat - tcp:%s:%d #"
+xlSocatCmd = "socat -b524288 - TCP:%s:%d #"
 
 xlMigrationPidfile :: String
 xlMigrationPidfile = "socat.pid"