On Tue, Jan 26, 2016 at 03:16:22PM -0000, Martin Pitt wrote:
> Public bug reported:
> 
> When running autopkgtests in remote containers (necessary for moving
> armhf autopkgtesting into the cloud) there is quite a noticeable
> overhead. Running lxc exec with a no-op locally takes almost no time:
> 
> ubuntu@lxd-armhf2:~$ time lxc exec x1 whoami
> root
> 
> real  0m0.076s
> user  0m0.010s
> sys   0m0.000s
> 
> But running this from a remote instance consistently has some 2.5 to 3.5
> s overhead:
> 
> ubuntu@lxd-controller:~$ lxc launch armhf2:cloud/xenial/armhf armhf2:x1
> ubuntu@lxd-controller:~$ time lxc exec --debug armhf2:x1  whoami </dev/null
> DBUG[01-26|15:08:20] Posting 
> {"command":["whoami"],"environment":{"HOME":"/root","TERM":"screen","USER":"root"},"interactive":false,"wait-for-websocket":true}
>  to https://10.43.42.59:8443/1.0/containers/x1/exec 
> DBUG[01-26|15:08:21] Raw response: 
> {"type":"async","status":"OK","status_code":100,"operation":"/1.0/operations/d183dcc6-5e94-43eb-9df8-35c963e8f2be","resources":null,"metadata":{"fds":{"0":"c10a5a34c84bfe86bdd4bc35c6a94349874b880ffb62a5709d01f15b97d92410","1":"fa77b9e2909863bb07247bf726223e46d8bf362284bd1cf74221e23cccc94885","2":"58337bcca5403e942a1f77f6acd899b6db9ab980ad8bfbef1cfea9470d52eae1","control":"0d55d71f9f8ebad1b8538f1c6538f86d1b973c1b368a1805af5b471baa9bc5b8"}}}
>  
> root
> DBUG[01-26|15:08:23] Got error getting next reader websocket: close 1000 , 
> &{%!s(*os.file=&{1 /dev/stdout <nil>})} 
> DBUG[01-26|15:08:23] Got error getting next reader websocket: close 1000 , 
> &{%!s(*os.file=&{2 /dev/stderr <nil>})} 
> DBUG[01-26|15:08:23] 1.0/operations/d183dcc6-5e94-43eb-9df8-35c963e8f2be/wait 
> DBUG[01-26|15:08:24] Raw response: 
> {"type":"sync","status":"Success","status_code":200,"metadata":{"created_at":"2016-01-26T15:08:21.388232Z","updated_at":"2016-01-26T15:08:23.814687Z","status":"Success","status_code":200,"resources":null,"metadata":{"return":0},"may_cancel":false}}
>  
> real    0m3.463s
> user    0m0.177s
> sys     0m0.021s
> 
> ubuntu@lxd-controller:~$ lxc remote list
> [...]
> | armhf2          | https://10.43.42.59:8443 | NO     |
> [...]
> 
> I suppose this is due to the overhead of https://, establishing a new
> connection every time etc. openssh has some "connection sharing" feature
> which avoids the overhead of the initial negotiation and authentication.
> This is rather complex, so maybe not something that we have in LXD, but
> are there some tweaks to speed this up? E. g. switching off SSL, or
> switching off authentication (I trust these boxes, and they are
> firewalled rather tightly).

How about forwarding with socat? untested:

socat TCP-LISTEN:8443,fork UNIX-CLIENT:/var/lib/lxd/unix.socket

and on the other host:

socat UNIX-CONNECT:/tmp/unix.socket TCP:10.0.0.1:8443 # or whatever your
IP is

then,

LXD_DIR=/tmp lxc list

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1538174

Title:
  ways to speed up overhead of "lxc exec" on remote containers

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/lxd/+bug/1538174/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to