[TriLUG] copying files

Alexey Toptygin alexeyt at freeshell.org
Fri Jun 22 11:17:33 EDT 2012


On Fri, 22 Jun 2012, Joseph Mack NA3T wrote:

> If I ssh to the remote machine and do a `find ./` on the remote directory and 
> return the ascii output back over the ssh connection and display it locally, 
> it takes 7 sec.
>
> So finding the timestamps over ssh should take 7 secs. The local time stamps 
> will be much faster and I expect just about any algorithm to compare file 
> sizes/timestamps will take 0 time compared to waiting for disk access. So a 
> null rsync should be 7secs tops.
>
> The remote directory is mounted sshfs. I expected that `find` executed 
> locally on an sshfs mounted filesystem would be as fast as `find` executed 
> remotely on the same directory over an ssh connection. I didn't even bother 
> to check whether this is true. But on the local machine if I do
>
> find ./sshfs_directory_from_remote_machine
>
> the find, that takes 7 secs when done on the remote machine, when done 
> locally on the sshfs mounted filesysem, takes 10mins. I didn't expect sshfs 
> to be so slow, as I get wirespeed with sshfs file transfers with it in both 
> directions.

Latency. Runnig find locally does all the readdirs and stats locally and 
_then_ ships bulk result data over the wire in big chunks. If you do the 
find over sshfs, find first does a readdir and it takes 1 RTT to get that 
data back, then it does a stat and it akes 1 RTT to get that data back. If 
you do a find on n files, it should take 2 * n * RTT longer over sshfs 
than locally.

 			Alexey



More information about the TriLUG mailing list