Bug 5954

Summary: [openssh]ssh connection is delayed for QEMU images using openssh
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Alexandru Palalau <alexandrux.palalau>
Component: coreAssignee: Saul Wold <sgw>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: Medium CC: bluelightning, meta.mr.watcher, meta.watcher, sstncr
Version: 1.6   
Target Milestone: 1.6 M5   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: Regression (Used to work)
Verified: Documentation change: Don't know

Description Alexandru Palalau 2014-03-12 14:27:23 UTC
For openssh images (core-image-sato-sdk), the ssh connection is delayed with almost 12s. For dropbear, the connection time is under 1s.
The behavior was encountered on QEMU images.
The connection is delayed at "debug1: SSH2_MSG_SERVICE_REQUEST sent"

I could override this by adding "UseDNS no" in /etc/ssh/sshd_config

core-image-sato-sdk (openssh) connection output:
$time ssh root@192.168.7.2 uname -a
Linux qemuarm 3.10.32-ltsi-yocto-standard #1 PREEMPT Tue Mar 11 08:51:38 EDT 2014 armv5tejl GNU/Linux

real	0m11.531s
user	0m0.016s
sys	0m0.006s


core-image-sato (dropbear) connection output:
$time ssh root@192.168.7.4 uname -a
Linux qemuarm 3.10.32-ltsi-yocto-standard #1 PREEMPT Tue Mar 11 08:51:38 EDT 2014 armv5tejl GNU/Linux

real	0m0.712s
user	0m0.013s
sys	0m0.004s

This bug has impact for QA tests available on AB:
http://autobuilder.yoctoproject.org/main/builders/nightly-x86-64/builds/91/steps/Running%20Sanity%20Tests/logs/stdio

core-image-sato - Ran 40 tests in 511.073s
core-image-sato - OK - All required tests passed
NOTE: recipe core-image-sato-1.0-r0: task do_testimage: Succeeded
core-image-sato-sdk - Ran 48 tests in 2256.444s
core-image-sato-sdk - OK - All required tests passed

For core-image-sato-sdk 2200 seconds is extremely long, it should be under 800 (if using UseDNS=no). That happens because each test runs commands over ssh, and for each command 12-15 seconds are added at connecting.
I'm pretty sure that for 1.5 this wasn't the case.
Comment 1 Paul Eggleton 2014-03-12 14:47:02 UTC
It would be interesting to try reverting 1964da1b483d58955abafa6119c4035f9444d86b (most recent openssh upgrade) and see if this makes a difference.
Comment 2 Stefan Stanacar 2014-03-13 07:37:45 UTC
Same thing with that reverted. 
How about a patch that sed's UseDNS yes in sshd_config just for qemu machines? Our qemu machine don't really have a DNS server, so asking openssh to do reverse checking in our qemu machines is pointless... and it adds a lot of time for the tests.
Comment 3 Saul Wold 2014-03-14 22:29:37 UTC
Just to confirm, this is trying to connect to the QEMU Target image from the 
host, not from within the QEMU image itself.
Comment 5 Alexandru Palalau 2014-04-10 08:00:48 UTC
Verified on master branch.
Commit ID: 1f42d829feb62271211e3d9afd5b21f9c1e2307d