how to test the performance of modified openssh
Daniel Kahn Gillmor
dkg-openssh.com at fifthhorseman.net
Sat Jan 12 07:29:30 EST 2008
On Fri 2008-01-11 14:55:52 -0500, Ben Lindstrom wrote:
> In both cases I believe the test was pretty much a "dd if=/dev/urandom ..
> | ssh '| cat /dev/null'" style testing or transferring of real data.
> Timing the time it takes to move XX amount of data then doing the math.
Be aware that if you're concerned about a CPU bottleneck for openssh,
dd'ing from /dev/urandom is going to confound your results. Pulling
only 5MB of data from /dev/urandom chews up over 2.5 seconds of CPU
time (inside the kernel, no less!) on a 1.2GHz P3 running Linux
2.6.22. here's two different ways of looking at it:
[0 dkg at squeak ~]$ time dd if=/dev/urandom bs=1K count=5K > /dev/null
5120+0 records in
5120+0 records out
5242880 bytes (5.2 MB) copied, 2.69792 seconds, 1.9 MB/s
real 0m2.723s
user 0m0.016s
sys 0m2.696s
[0 dkg at squeak ~]$ (sleep 2 && dd if=/dev/urandom bs=1K count=5K > /dev/null 2>/dev/null) & vmstat 1 10
[1] 14475
procs -----------memory---------- ---swap-- -----io---- -system-- ----cpu----
r b swpd free buff cache si so bi bo in cs us sy id wa
2 0 420188 6352 4776 76720 3 2 52 32 5 2 7 1 90 2
0 0 420188 6364 4776 76720 0 0 0 0 75 206 0 0 100 0
1 0 420188 6364 4776 76720 0 0 0 0 75 117 0 2 98 0
1 0 420188 6364 4776 76720 0 0 0 0 255 83 0 100 0 0
1 0 420188 6364 4776 76720 0 0 0 0 266 111 0 100 0 0
0 0 420188 6432 4776 76720 0 0 0 0 278 143 0 67 33 0
0 0 420188 6452 4776 76720 0 0 0 0 109 131 0 0 100 0
0 0 420188 6452 4776 76720 0 0 0 0 87 119 0 0 100 0
0 0 420188 6452 4776 76720 0 0 0 0 212 213 0 1 99 0
1 0 420188 6452 4776 76720 0 0 0 0 132 152 0 0 100 0
[1]+ Done ( sleep 2 && dd if=/dev/urandom bs=1K count=5K >/dev/null 2>/dev/null )
[0 dkg at squeak ~]$
So if ssh is contending with the kernel's PRNG and the CPU is pegged
at 100%, you'll see a throughput performance degradation as a result.
It's probably better to dd from /dev/urandom to a large (RAM-backed)
file and feed a continuous loop from the file for throughput tests to
avoid this problem.
--dkg
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 826 bytes
Desc: not available
Url : http://lists.mindrot.org/pipermail/openssh-unix-dev/attachments/20080111/24aaaec3/attachment.bin
More information about the openssh-unix-dev
mailing list