hjp: zettel: scp performance

scp performance

Speed comparison between various ciphers supported by SSH. The test measures the time to copy a file from the client to the server using scp. This script was used to run the tests. I used the linux source code as a test file because it has a reasonable size (about ½ Gig) and can be compressed.

Key findings:

  • Performance improved a lot over the last 3 years. I'm not sure whether this is because of hardware or software improvements. I'll have to repeat these measurements on old hardware with new SSH versions some day.
  • In late 2013, only arcfour could saturate a gigabit lan. In early 2017, all algorithms can. The AES variants are all close to 5 Gbit/s.
  • Chacha20 is much slower than AES, but only if you have faster h
  • Compression is always a bad idea on a gigabit LAN. It It should be beneficial at speeds below ~ 300 Mbit/s (with fast CPUs).
Client CPUIntel(R) Xeon(R) CPU E5-2643 v3 @ 3.40GHz
Client SSHOpenSSH_6.7p1 Debian-5+deb8u3, OpenSSL 1.0.1t 3 May 2016
Server CPUIntel(R) Xeon(R) CPU E5-2643 v3 @ 3.40GHz
Server SSHSSH-2.0-OpenSSH_6.7p1 Debian-5+deb8u3
Networkloopback
Filelinux-4.9.11.tar (664MiB)
Note
CipherCompressionSpeed MiB/selapsed (min:s)
aes192-ctr552.500:01.2
aes256-gcm@openssh.com551.700:01.2
aes128-gcm@openssh.com536.100:01.2
aes128-ctr509.600:01.3
497.000:01.3
aes256-ctr488.200:01.4
chacha20-poly1305@openssh.com209.700:03.2
aes128-ctr-C35.500:18.7
aes192-ctr-C35.400:18.7
aes256-ctr-C35.200:18.8
aes128-gcm@openssh.com-C35.200:18.9
-C34.900:19.0
aes256-gcm@openssh.com-C34.700:19.1
chacha20-poly1305@openssh.com-C33.900:19.6
Client CPUIntel(R) Xeon(R) CPU E5-2643 v3 @ 3.40GHz
Client SSHOpenSSH_6.7p1 Debian-5+deb8u3, OpenSSL 1.0.1t 3 May 2016
Server CPUIntel(R) Xeon(R) CPU E5-2643 v3 @ 3.40GHz
Server SSHSSH-2.0-OpenSSH_6.7p1 Debian-5+deb8u3
Network1 Gbit/s LAN
Filelinux-4.9.11.tar (664MiB)
Note
CipherCompressionSpeed MiB/selapsed (min:s)
aes256-ctr109.500:06.1
aes128-ctr109.500:06.1
109.500:06.1
aes192-ctr109.500:06.1
aes128-gcm@openssh.com109.400:06.1
chacha20-poly1305@openssh.com109.300:06.1
aes256-gcm@openssh.com109.300:06.1
aes128-gcm@openssh.com-C36.500:18.2
aes256-gcm@openssh.com-C36.400:18.2
aes128-ctr-C36.400:18.2
aes256-ctr-C36.400:18.2
-C36.000:18.5
aes192-ctr-C35.900:18.5
chacha20-poly1305@openssh.com-C35.600:18.7
Client CPUIntel(R) Core(TM)2 Duo CPU E8400 @ 3.00GHz
Client SSHOpenSSH_6.0p1 Debian-4, OpenSSL 1.0.1e 11 Feb 2013 (32 bit)
Server CPUIntel(R) Core(TM)2 CPU 6300 @ 1.86GHz
Server SSHSSH-2.0-OpenSSH_6.0p1 Debian-4 (32 bit)
NetworkWAN connection. Uplink limited to 24 Mbit/s at the client side with traffic shaping. 25/5 Mbit/s cable on server side.
Filelinux-3.12.tar (519 MiB)
Note
CipherCompressionSpeed MiB/selapsed (min:s)
aes256-ctr-C9.800:52.8
aes192-cbc-C9.800:53.0
arcfour128-C9.500:54.6
aes256-cbc-C9.500:54.7
aes128-ctr-C9.500:54.8
arcfour256-C9.200:56.4
-C9.100:56.8
aes192-ctr-C9.000:57.4
cast128-cbc-C8.700:59.6
3des-cbc-C8.401:02.1
arcfour-C8.201:03.1
blowfish-cbc-C7.501:09.3
aes128-cbc-C7.101:12.9
aes128-cbc2.104:04.3
aes192-cbc2.104:05.1
aes256-cbc2.104:07.7
aes128-ctr2.104:09.9
3des-cbc2.004:18.7
arcfour2561.904:26.4
1.904:30.7
arcfour1281.904:31.8
arcfour1.904:40.3
cast128-cbc1.804:47.7
aes192-ctr1.804:49.0
aes256-ctr1.804:50.3
blowfish-cbc1.804:54.9
Client CPUIntel Atom E6xx [Genuine Intel(R) CPU @ 1.60GHz]
Client SSHOpenSSH_6.0p1 Debian-4, OpenSSL 1.0.1e 11 Feb 2013 (32 bit)
Server CPUIntel Atom E6xx [Genuine Intel(R) CPU @ 1.60GHz]
Server SSHSSH-2.0-OpenSSH_6.0p1 Debian-4 (32 bit)
Network1 Gbit/s directly connected
Filelinux-3.12.tar (519 MiB)
Note
CipherCompressionSpeed MiB/selapsed (min:s)
arcfour25634.000:15.2
arcfour12834.000:15.2
arcfour33.800:15.3
blowfish-cbc20.800:24.9
cast128-cbc14.500:35.7
aes128-cbc11.000:47.4
aes192-cbc9.500:54.4
aes128-ctr9.300:55.6
9.300:55.8
aes256-cbc8.301:02.3
aes192-ctr8.101:03.9
aes256-ctr7.201:12.0
3des-cbc6.201:23.8
arcfour-C4.601:53.3
arcfour256-C4.601:53.5
arcfour128-C4.601:53.5
blowfish-cbc-C4.501:56.3
cast128-cbc-C4.401:58.1
aes128-cbc-C4.401:58.5
aes192-cbc-C4.401:58.5
aes256-cbc-C4.302:00.4
aes192-ctr-C4.202:02.5
-C4.202:02.8
aes128-ctr-C4.202:03.0
aes256-ctr-C4.102:05.1
3des-cbc-C4.002:09.2
Client CPUIntel(R) Xeon(R) CPU E5520 @ 2.27GHz
Client SSHOpenSSH_5.5p1 Debian-6+squeeze3, OpenSSL 0.9.8o 01 Jun 2010 (64 bit)
Server CPUIntel(R) Xeon(R) CPU E5530 @ 2.40GHz
Server SSHSSH-2.0-OpenSSH_6.0p1 Debian-4 (64 bit)
Network1 Gbit/s LAN
Filelinux-3.12.tar (519 MiB)
Note
CipherCompressionSpeed MiB/selapsed (min:s)
arcfour94.000:05.5
arcfour25685.300:06.1
aes128-cbc83.800:06.2
arcfour12882.300:06.3
aes192-cbc77.100:06.7
aes256-cbc71.400:07.3
blowfish-cbc55.100:09.4
aes128-ctr52.900:09.8
52.400:09.9
cast128-cbc51.100:10.1
aes192-ctr46.900:11.1
aes256-ctr41.500:12.5
arcfour128-C19.900:26.1
arcfour-C19.800:26.2
-C19.800:26.2
aes192-ctr-C19.800:26.3
aes256-cbc-C19.700:26.3
aes128-cbc-C19.400:26.8
aes192-cbc-C19.200:27.0
blowfish-cbc-C19.200:27.0
aes128-ctr-C18.800:27.6
cast128-cbc-C18.700:27.7
aes256-ctr-C18.600:27.8
arcfour256-C17.500:29.7
3des-cbc17.300:30.0
3des-cbc-C16.400:31.7
Client CPUIntel(R) Core(TM)2 Duo CPU E8400 @ 3.00GHz
Client SSHOpenSSH_6.0p1 Debian-4, OpenSSL 1.0.1e 11 Feb 2013 (32 bit)
Server CPUIntel(R) Core(TM)2 Duo CPU E8400 @ 3.00GHz
Server SSHSSH-2.0-OpenSSH_6.0p1 Debian-4
Networkloopback
Filelinux-3.12.tar (519 MiB)
Note
CipherCompressionSpeed MiB/selapsed (min:s)
arcfour128140.300:03.7
arcfour139.000:03.7
arcfour256137.400:03.8
aes128-cbc98.400:05.3
aes192-cbc90.700:05.7
aes256-cbc79.900:06.5
blowfish-cbc69.900:07.4
56.400:09.2
aes128-ctr55.600:09.3
cast128-cbc54.000:09.6
aes192-ctr50.700:10.2
aes256-ctr45.900:11.3
3des-cbc21.500:24.2
arcfour128-C17.400:29.8
arcfour-C17.300:30.0
arcfour256-C17.300:30.0
aes128-cbc-C17.100:30.4
aes192-cbc-C17.000:30.6
aes256-cbc-C16.900:30.7
blowfish-cbc-C16.500:31.4
-C16.200:32.1
aes128-ctr-C16.100:32.1
cast128-cbc-C16.100:32.3
aes192-ctr-C15.800:32.8
aes256-ctr-C15.700:33.1
3des-cbc-C13.500:38.5

The following results were obtained by hand or with a shell script. They may not be directly comparable to the results above.

ClientIntel(R) Xeon(R) CPU E5520 @ 2.27GHz (VMware guest)
ServerIntel(R) Xeon(R) CPU E5520 @ 2.27GHz (VMware guest)
File5144 MiB gzipped mysql dump
NoteThe client was busy at the time, YMMV
Cipher Speed (MB/s) elapsed (m:s)
arcfour128 41.5 02:04
aes128-cbc 34.3 02:30
blowfish-cbc 30.3 02:50
default (aes128-ctr?) 26.8 03:12
ClientIntel(R) Core(TM)2 Duo CPU E8400 @ 3.00GHz
ServerIntel(R) Xeon(R) CPU E5-2640 0 @ 2.50GHz (VMware guest)
File512 MiB 0 filled
Cipher Speed (MB/s) elapsed (m:s)
aes128-cbc 73.1 00:07
arcfour128 56.9 00:09
arcfour 56.9 00:09
aes256-cbc 56.9 00:09
aes192-cbc 51.2 00:10
blowfish-cbc 46.6 00:11
arcfour256 46.6 00:11
aes128-ctr 39.4 00:13
aes192-ctr 36.6 00:14
cast128-cbc 34.1 00:15
aes256-ctr 32.0 00:16
3des-cbc 14.6 00:35