juju deploy is too slow
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Canonical Juju |
Triaged
|
High
|
Unassigned |
Bug Description
Deploying a local .charm takes more than 1 minute:
$ time juju deploy --debug ./lxd-cloud-
12:49:08 INFO juju.cmd supercommand.go:56 running juju [2.9.33 95186b2e0c2dfa9
12:49:08 DEBUG juju.cmd supercommand.go:57 args: []string{
12:49:08 INFO juju.juju api.go:78 connecting to API addresses: [172.17.
12:49:08 DEBUG juju.api apiclient.go:1153 successfully dialed "wss://
12:49:08 INFO juju.api apiclient.go:688 connection established to "wss://
12:49:08 INFO juju.juju api.go:78 connecting to API addresses: [172.17.
12:49:08 DEBUG juju.api apiclient.go:1153 successfully dialed "wss://
12:49:08 INFO juju.api apiclient.go:688 connection established to "wss://
12:49:13 DEBUG juju.core.charm computedseries.
12:49:13 INFO juju.cmd.
12:49:13 DEBUG juju.core.charm computedseries.
12:49:13 INFO cmd charm.go:384 Preparing to deploy local charm: "lxd-cloud-
12:50:17 INFO cmd charm.go:406 Located local charm "lxd-cloud-cell", revision 13
12:50:23 INFO cmd charm.go:236 Deploying "cell-a" from local charm "lxd-cloud-cell", revision 13 on jammy
12:50:25 DEBUG juju.api monitor.go:35 RPC connection died
12:50:25 DEBUG juju.api monitor.go:35 RPC connection died
12:50:25 INFO cmd supercommand.go:544 command finished
real 1m17.398s
user 0m3.883s
sys 0m6.742s
Both local files are small:
$ ll -h lxd-cloud-
-rw-rw-r-- 1 sdeziel sdeziel 20M Aug 2 22:02 lxd-cloud-
-rw-r--r-- 1 sdeziel sdeziel 5.8M Aug 17 19:17 lxd-cloud-
And the juju controller is a local LXD instance on the same machine so the network is rather fast:
$ lxc ls
+------
| NAME | STATE | IPV4 | IPV6 | TYPE | SNAPSHOTS |
+------
| juju-492fcd-0 | RUNNING | 172.17.40.184 (eth0) | | CONTAINER | 0 |
+------
$ ping 172.17.40.184
PING 172.17.40.184 (172.17.40.184) 56(84) bytes of data.
64 bytes from 172.17.40.184: icmp_seq=1 ttl=64 time=0.089 ms
64 bytes from 172.17.40.184: icmp_seq=2 ttl=64 time=0.090 ms
^C
--- 172.17.40.184 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1008ms
rtt min/avg/max/mdev = 0.089/0.
Juju probably doesn't use the LXD file transfer facility but here are some numbers for comparison:
$ time lxc file push lxd-cloud-
real 0m2.910s
user 0m0.115s
sys 0m0.158s
$ time lxc file push lxd-cloud-
real 0m1.220s
user 0m0.121s
sys 0m0.211s
After calling `juju deploy`, there appears to be a ~1 minute "pause" which probably corresponds to:
12:49:13 INFO cmd charm.go:384 Preparing to deploy local charm: "lxd-cloud-
12:50:17 INFO cmd charm.go:406 Located local charm "lxd-cloud-cell", revision 13
Additional information:
$ lsb_release -rd
Description: Ubuntu 20.04.4 LTS
Release: 20.04
$ uname -a
Linux shell01 5.19.2+ #50 SMP Sat Aug 20 02:52:38 UTC 2022 aarch64 aarch64 aarch64 GNU/Linux
$ snap list juju lxd
Name Version Rev Tracking Publisher Notes
juju 2.9.33 20277 latest/stable canonical✓ classic
lxd 5.4-1ff8d34 23371 latest/stable canonical✓ -
Changed in juju: | |
milestone: | 2.9.34 → 2.9.35 |
Changed in juju: | |
milestone: | 2.9.35 → 2.9.36 |
Changed in juju: | |
milestone: | 2.9.36 → 2.9.37 |
Changed in juju: | |
milestone: | 2.9.37 → 2.9.38 |
Changed in juju: | |
milestone: | 2.9.38 → 2.9.39 |
Changed in juju: | |
milestone: | 2.9.39 → 2.9.40 |
Changed in juju: | |
milestone: | 2.9.40 → 2.9.41 |
Changed in juju: | |
milestone: | 2.9.41 → 2.9.42 |
Changed in juju: | |
milestone: | 2.9.42 → 2.9.43 |
Changed in juju: | |
milestone: | 2.9.43 → 2.9.44 |
Changed in juju: | |
milestone: | 2.9.44 → 2.9.45 |
Changed in juju: | |
milestone: | 2.9.45 → 2.9.46 |
juju does push the resource to the controller which stores it in mongo gridfs. I wonder if this is where the time is going. 20M doesn't seem overly large though. We'll need to investigate a bit.