New issue
Advanced search Search tips

Issue 837445 link

Starred by 6 users

Issue metadata

Status: Verified
Owner:
Closed: Nov 5
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug


Show other hotlists

Hotlists containing this issue:
LXD


Sign in to add a comment

lxd first startup is slow on arm

Project Member Reported by sonnyrao@chromium.org, Apr 26 2018

Issue description

On kevin the first time we start lxd it seems to take much longer than 10 seconds and in some cases maybe longer than 30 seconds.

We should figure out why
 
Project Member

Comment 1 by bugdroid1@chromium.org, Apr 27 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform2/+/468c6f13981de5309adc0f01272523265f74967a

commit 468c6f13981de5309adc0f01272523265f74967a
Author: Sonny Rao <sonnyrao@chromium.org>
Date: Fri Apr 27 21:36:58 2018

vm_tools: make the lxd ready and client start timeouts longer

On Kevin the very first invocation of lxd seems to take a long time --
sometimes more than 40 seconds, so we need to make the wait ready
timout and the client vm start timeouts longer. Longer term we'd like
to figure out what it's doing and optimize the first invocation of
lxd.

BUG= chromium:837445 
TEST=manual test on kevin

Change-Id: Id3ff9201ab1664f10f22a49bf3e0cfee60afe689
Reviewed-on: https://chromium-review.googlesource.com/1031738
Commit-Ready: Sonny Rao <sonnyrao@chromium.org>
Tested-by: Sonny Rao <sonnyrao@chromium.org>
Reviewed-by: Chirantan Ekbote <chirantan@chromium.org>

[modify] https://crrev.com/468c6f13981de5309adc0f01272523265f74967a/vm_tools/concierge/service.cc
[modify] https://crrev.com/468c6f13981de5309adc0f01272523265f74967a/vm_tools/concierge/client.cc

Labels: -Pri-3 M-70 Pri-2
I should look closer at this for M-70
Components: OS>Systems>Containers
Labels: Proj-Containers OS-Chrome
I think I found the culprit: 4096-bit RSA key generation, which happens on LXD's first startup. The math for this is pretty slow, especially on 32-bit ARM.

We could:
1) Generate ECDSA certs which are much, much smaller.
and/or
2) Add a config to LXD to disable TLS (and serving the REST API over TCP), since we only use the unix domain socket.

Sounds like a good upstreaming candidate :)
lxd.svg
324 KB Download
Oh nice -- I guess option 1 wouldn't require any changes to lxd but option 2 would?
Both would require LXD changes. The cert generation code right now only does 4096-bit RSA: https://github.com/lxc/lxd/blob/2c80ee64df0f84201d2c06860a07258c7f761966/shared/cert.go#L250
> Sounds like a good upstreaming candidate :)

It does indeed. :)
Cc: sonnyrao@chromium.org
Owner: ----
Status: Available (was: Assigned)
I'm not currently working on this, but someone knowledgeable in go should take it
Owner: jkwang@google.com
Status: Assigned (was: Available)
Which of the two approaches are you working on?

Seems to me like having the server certificate generated on-demand on the server side would be pretty easy to do and certainly something we'd be quite willing to merge upstream.

Let me know if you're running into problems and please send us a PR when you have something we can look at.
I think we'd have the cert generated on-demand.
Labels: -M-70 M-72
Owner: smbar...@chromium.org
Upstream has switched to generating EC384 so I'll pick that patch instead.

https://github.com/lxc/lxd/pull/5206

https://github.com/lxc/lxd/issues/5064
Status: Verified (was: Assigned)
Verified with component 11220.0.0.

Sign in to add a comment