SSH GenerateKey very slow on ARM

Bug #1312850 reported by Martin Packman
8
This bug affects 1 person
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.f="(Generate|ClientKeys)Suite")
PASS: clientkeys_test.go:101: ClientKeysSuite.TestLoadClientKeysDirExists 26.505s
PASS: clientkeys_test.go:74: ClientKeysSuite.TestPrivateKeyFiles 64.608s
PASS: clientkeys_test.go:51: ClientKeysSuite.TestPublicKeyFiles 42.043s
PASS: generate_test.go:20: GenerateSuite.TestGenerate 24.356s
OK: 4 passed
PASS
ok launchpad.net/juju-core/utils/ssh 158.500s

$ 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.

Tags: ssh arm

Related branches

Revision history for this message
Martin Packman (gz) wrote :
tags: added: arm ssh
Go Bot (go-bot)
Changed in juju-core:
status: Triaged → Fix Committed
Martin Packman (gz)
Changed in juju-core:
status: Fix Committed → Triaged
Curtis Hovey (sinzui)
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
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.