Dr Ed Brambley's Miscellaneous Projects (2024)

This page documents rough and ready speed tests I performed to investigate how best to copy files between two Linux computers across a fast network. The conclusions are that scp and rsync leave a lot to be desired, that sshfs and sftp are the slowest of the bunch by a factor of up to 16 for lots of small files, and that up to 8 times times faster transfers than with scp can be obtained using tar over ssh while still retaining a secure connection.

For details of the newer tests which are not limited by hard drive speed, please see below.

Details of the older tests

Tests were performed transferring data between two computers running Ubuntu 10.04.4 LTS (Lucid Lynx). The two computers contained dual core Intel Pentium D 3.2GHz processors and 4GB of memory, and were connected using Intel pro/1000 ethernet adaptors over a gigabit ethernet connection through an old but high performance Cisco switch. The hard drive on each machine had a write speed of approximately 50MB/s; this is rather slow, and so efficient nonblocking and buffering will be an important feature of these speed tests.

Two data sets were tested. An incompressible data set consisted of 200 files each of 10MB of random data from /dev/urandom. A compressible data set consisted of the uncompressed GCC4.6.3 source tree (610MB).

All measurements are given as average±standard deviation, where standard deviation is not provided if it is zero to the stated precision. These measurements are taken from a number (usually 5) of independent transfers.

Several methods of transfer were considered. These are listed below for transferring from src to dest on computer remote:

scp
scp -r src remote:dest
rsync
rsync -r src remote:dest, using rsync version 3.0.7 protocol version 30.
tar over ssh
tar -cf- src | ssh -q remote tar -xf- -Cdest
tar over netcat
ssh -f remote "nc -l 7111 | tar -xf- -Cdest" ; tar -cf- src | nc remote 7111. This in fact suffered some problems with ssh not backgrounding properly and netcat not correctly listening or correctly parsing end of file codes.
sshfs
sshfs remote:dest mnt ; cp -r src mnt ; fusermount -u mnt, using sshfs version 2.2, fuse library version 2.8.1, and fuse kernel interface version 7.12.

In all cases, the version of ssh used was OpenSSH_5.3p1 Debian-3ubuntu7, OpenSSL 0.9.8k 25 Mar 2009, and the version of (GNU) tar used was 1.22. All tests were run using the default options unless specified. For the version of ssh used, the default cipher is aes128-ctr and the default MAC is hmac-md5.

Initial tests and ssh ciphers

The first tests aimed to find the fastest ssh ciphers and compare them with the other methods. All tests in here are on incompressible data.

programcipher
defaultaes128-ctraes128-cbcblowfish-cbccast128-cbcarcfour128arcfour
scp33.7±0.7MB/s33.6±0.1MB/s33.7±0.1MB/s33.8±0.1MB/s31.1±0.1MB/s34.4±0.7MB/s33.8±0.1MB/s
tar over ssh53.3MB/s53.4MB/s64.9MB/s52.9MB/s33.9MB/s85.3±0.1MB/s85.8±0.3MB/s
rsync32.4±0.2MB/s33.5±0.5MB/s33.7±0.6MB/s33.7±0.7MB/s33.3±0.3MB/s34.5±0.3MB/s33.8±0.5MB/s
tar over netcat58.5±2.0MB/s

I conclude that:

  1. tar over either ssh or netcat are far faster than the other methods, possibly because tar and the transfer run in parallel, getting around the hard disk speed bottleneck.
  2. arcfour is the fastest cipher, and aes128-cbc is faster than the default aes128-ctr. Note that blowfish-cbc is not particularly fast.
  3. ssh is faster than netcat using either the aes128-cbc or arcfour ciphers.

ssh Message Authentication Codes (MACs)

The second tests aimed to find the fastest ssh Message Authentication Codes (MACs) and compare them with the other methods. All tests here are on incompressible data using the arcfour cipher found above to be the fastest in this case.

programMAC
hmac-md5hmac-md5-96hmac-sha1hmac-sha1-96hmac-ripemd160umac-64@openssh.com
scp34.0±0.1MB/s33.9±0.4MB/s34.0±0.4MB/s34.0±0.1MB/s33.9±0.3MB/s34.0±0.1MB/s
tar over ssh85.7±0.2MB/s83.9±0.3MB/s73.2±0.2MB/s73.8±0.1MB/s62.1±0.1MB/s96.7±0.2MB/s
rsync33.6±0.7MB/s34.0±1.3MB/s34.1±0.4MB/s33.4±0.7MB/s33.8±0.6MB/s34.0±0.8MB/s

I conclude that:

  1. For the scp and rsync methods, the bottleneck is elsewhere and the MAC makes little difference.
  2. For the tar over ssh method, the MAC makes a significant difference, with the new umac-64@openssh.com outperforming everything, and the default hmac-md5 coming a not-too-distant second.

Managing compressibility

The third tests aimed to find the best way to deal with compressibility. In addition to ssh's -C flag which enables compression within ssh, rsync offer the -z flag and tar offers both the -z and -j flags. The -j flag uses bzip2 for compression, while all the others use gzip.

All tests were performed using the arcfour cipher and umac-64@openssh.com MAC.

programdatacompression
none-C-z-j
scpcompressible9.5±0.3MB/s6.5±0.1MB/s
tar over sshcompressible100.5±0.9MB/s16.7±0.1MB/s17.3±0.2MB/s5.0MB/s
rsynccompressible12.5±0.2MB/s11.7±0.2MB/s11.4±0.1MB/s
sshfscompressible4.4MB/s3.3MB/s
scpincompressible34.7±0.3MB/s13.8MB/s
tar over sshincompressible102.7±1.8MB/s13.7±0.1MB/s13.3±0.2MB/s2.5MB/s
rsyncincompressible34.5±0.5MB/s33.7±0.5MB/s33.7±0.5MB/s
sshfsincompressible33.2±0.5MB/s10.9MB/s

I conclude that:

  1. On these computers where the connection speed is so fast as to not be limiting, not using compression beats using compression every time even when what is being transferred is compressible.
  2. At least on these computers, tar over ssh (without compression) is significantly faster than every other method. Again, this may be because the two separate processes get around the limitations of the slow hard drive.
  3. sshfs is terrible at transferring a large number of small files (as seen from the compressible case).
  4. bzip2 is too slow to be used for on-the-fly compression.
  5. The speed of rsync appears to be independent of whether and what type of compression is used.

Newer tests without hard drives

These newer tests were performed on a newer cluster, so are not directly comparable with the ones given above. The operating system this time was Ubuntu 12.04.3 LTS, running on two-core AMD Opteron 270 2.0GHz processors linked by a gigabit ethernet connection through an old but high performance Cisco switch. This time, RAM disks were used at either end to avoid the hard drive bottleneck; in the fastest tests, speeds of up to 0.9Gb/s were reached, showing that the network link is now the bottleneck.

The same data sets as before were used; one with lots of small compressible files, and one with 200 × 10MB incompressible files. All tests were using the Ciphers=arcfour128 and MACs=umac-64@openssh.com ssh options. This time, multiplexing connections was also tested. This was set up using ssh -M -S mux -fN <target>, and was used using the -S mux option passed to ssh. The results were:

programcompressible small filesincompressible large files
no multiplexingmultiplexingno multiplexingmultiplexing
sshfs3.4±0.0MB/s3.4±0.0MB/s75.8±0.6MB/s84.4±0.5MB/s
sftp4.2±0.0MB/s4.3±0.0MB/s110.6±0.1MB/s110.9±0.0MB/s
scp8.0±0.0MB/s8.0±0.0MB/s112.6±0.0MB/s113.1±0.0MB/s
rsync38.4±0.5MB/s38.8±0.3MB/s102.2±0.3MB/s106.9±3.2MB/s
tar over ssh69.2±0.2MB/s70.2±0.1MB/s113.5±0.0MB/s114.1±0.0MB/s

I conclude that:

  1. Multiplexing does not offer much of an advantage for any of these methods.
  2. tar over ssh is still by far the fastest. rsync again comes second.
  3. sshfs, sftp and to some extent scp are terrible at transferring a large number of small files. sshfs is also poor when transferring larger files too.
  4. The results of this test are broadly in agreement with the previous results, now that the bandwidth limit imposed by the hard drive is removed. The only inconsistency is for tar over ssh for the compressible files, with the new result being more believable.
Dr Ed Brambley's Miscellaneous Projects (2024)
Top Articles
International Remittance | Fees and charges - HSBC IN
How to Transfer Money from India to USA Without Tax
AllHere, praised for creating LAUSD’s $6M AI chatbot, files for bankruptcy
Ffxiv Shelfeye Reaver
Cottonwood Vet Ottawa Ks
Phcs Medishare Provider Portal
Craigslist Parsippany Nj Rooms For Rent
Hertz Car Rental Partnership | Uber
Mivf Mdcalc
Tabler Oklahoma
Nexus Crossword Puzzle Solver
2135 Royalton Road Columbia Station Oh 44028
Hope Swinimer Net Worth
Jasmine Put A Ring On It Age
Diablo 3 Metascore
About Us | TQL Careers
Darksteel Plate Deepwoken
Mills and Main Street Tour
How To Cut Eelgrass Grounded
9044906381
Icivics The Electoral Process Answer Key
Wbiw Weather Watchers
College Basketball Picks: NCAAB Picks Against The Spread | Pickswise
SN100C, An Australia Trademark of Nihon Superior Co., Ltd.. Application Number: 2480607 :: Trademark Elite Trademarks
Southwest Flight 238
Nk 1399
EVO Entertainment | Cinema. Bowling. Games.
Yale College Confidential 2027
Unity Webgl Car Tag
Hrconnect Kp Login
UAE 2023 F&B Data Insights: Restaurant Population and Traffic Data
The Hoplite Revolution and the Rise of the Polis
Shaman's Path Puzzle
Dr. John Mathews Jr., MD – Fairfax, VA | Internal Medicine on Doximity
Puffco Peak 3 Red Flashes
My.lifeway.come/Redeem
Nsav Investorshub
Electronic Music Duo Daft Punk Announces Split After Nearly 3 Decades
Wait List Texas Roadhouse
F9 2385
Pokemon Reborn Gyms
At Home Hourly Pay
Sofia Franklyn Leaks
Mychart Mercy Health Paducah
Television Archive News Search Service
My Eschedule Greatpeople Me
How to Connect Jabra Earbuds to an iPhone | Decortweaks
Sherwin Source Intranet
Motorcycles for Sale on Craigslist: The Ultimate Guide - First Republic Craigslist
SF bay area cars & trucks "chevrolet 50" - craigslist
Publix Store 840
Festival Gas Rewards Log In
Latest Posts
Article information

Author: Kelle Weber

Last Updated:

Views: 5767

Rating: 4.2 / 5 (73 voted)

Reviews: 80% of readers found this page helpful

Author information

Name: Kelle Weber

Birthday: 2000-08-05

Address: 6796 Juan Square, Markfort, MN 58988

Phone: +8215934114615

Job: Hospitality Director

Hobby: tabletop games, Foreign language learning, Leather crafting, Horseback riding, Swimming, Knapping, Handball

Introduction: My name is Kelle Weber, I am a magnificent, enchanting, fair, joyous, light, determined, joyous person who loves writing and wants to share my knowledge and understanding with you.