SSH GenerateKey very slow on ARM
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
juju-core |
Fix Released
|
Low
|
Martin Packman |
Bug Description
Generating an SSH key is very slow on ARM due to unoptimised golang math functions. Several tests in utils/ssh that generate a key also end up extremely slow:
$ (cd utils/ssh/&&go test -gocheck.v -gocheck.
PASS: clientkeys_
PASS: clientkeys_
PASS: clientkeys_
PASS: generate_
OK: 4 passed
PASS
ok launchpad.
$ head -n 6 /proc/cpuinfo
Processor : ARMv7 Processor rev 4 (v7l)
processor : 0
BogoMIPS : 1694.10
processor : 1
BogoMIPS : 1694.10
As the generation function reads from /dev/urandom this shouldn't be an entropy issue, benchmarking shows most time spent under ProbablyPrime in the math package. Lack of custom assembly is probably hurting here compared to amd64.
For the tests, the generation could probably be mocked out to not do all this work.
Related branches
- Juju Engineering: Pending requested
-
Diff: 115 lines (+36/-1)6 files modifiedutils/ssh/clientkeys_test.go (+2/-0)
utils/ssh/export_test.go (+1/-0)
utils/ssh/generate.go (+4/-1)
utils/ssh/generate_test.go (+26/-0)
utils/ssh/ssh_gocrypto_test.go (+2/-0)
utils/ssh/ssh_test.go (+1/-0)
Changed in juju-core: | |
status: | Triaged → Fix Committed |
Changed in juju-core: | |
status: | Fix Committed → Triaged |
Changed in juju-core: | |
milestone: | none → 1.19.2 |
assignee: | nobody → Martin Packman (gz) |
status: | Triaged → Fix Committed |
Changed in juju-core: | |
status: | Fix Committed → Fix Released |