Given two Linux boxes on a LAN, what's the simplest way to transfer files between them?
Simple File Transfer Methods
file-sharingnetworking
Related Solutions
I can only provide a guess, which is that the discrepancy is explained by varying computational, memory, caching or disk characteristics of the two hosts:
If we assume that CPU is a bottleneck, then it would make some sense if the slower machine were slower at sending (this assumes that encrypting is more computationally heavy than decrypting). This can be tested by switching to a cipher that is lighter to compute (try adding
-c arcfour
to your SSH command line; in this case, passing--rsh="ssh -c arcfour"
torsync
).If we assume that files are being read / written straight from / to the disk, then the disk could conceivably be a bottleneck; read speeds of 100 MBps are well within reach of more modern computers, but not of older ones, or computers running on laptop-class drives (such as, I believe, the Mac Mini).
If we further assume that the operating system uses filesystem caches, the situation could be complicated further:
If the source file is contained in the filesystem cache, in RAM, then it can be read much faster than 100 MBps;
if the target system applies write-caching and is able to fit a significant part of the file in RAM (in your case it should be, since RAM is much bigger than your test file), then it can claim the write is complete before it has actually reached the disk (this could mean that your measured 200MBps is).
The disk-versus-cache unknown can be tested by flushing the filesystem cache prior to reading (how to do so is OS-dependent): then sending the file will be at least as slow as the disk dictates. Conversely, by reading the file completely before sending (perhaps with cat file.bin >/dev/null
), one can influence the OS into caching it.
To further investigate whether CPU is an issue, it would make sense to run top
while the transfer is ongoing; if the rsync
or ssh
process is taking 100% of a core, then that would be a bottleneck.
Yes, USB 3.0 makes full duplex data transfer possible, with 3.0 cabling. The specs are in section 5.5.2 of the USB specs. The link to those specs is given earlier in another answer. http://www.gaw.ru/pdf/interface/usb/USB%203%200_english.pdf
Cables are becoming easier to find- they can be bought on Amazon, for example, for under $8.00. be sure to buy DATA TRANSFER, male A to male A cables. Newer versions of Linux support the transfer.
I hope that helps someone- I searched for the answer for quite a while myself.
Best Answer
I use
scp
.to copy from the local machine to the remote machine, or
to copy from a remote machine to the local machine.
If the username is not the same on the remote machine,