# sshfs vs samba vs samba-over-ssh vs scp performance

## terminallymortal

Just curious if anyone might be able to explain why samba-over-ssh is so much slower than bare samba or scp.

I'm attempting to make a network share of some sort between two machines:

server <----DLink Gig switch -----> client

sshfs seems to crap out fairly quickly (I'm using a ~3gig file as a test) so I can't get any times with it:

cp: writing `/mountpoint/testfile.tar.gz': Input/output error

cp: closing `/mountpoint/testfile.tar.gz': Software caused connection abort

Mount point/ssh connection disappears

fuse compiled as module.

What's more interesting to me is the comparison of moving that file via samba vs samba-over-ssh.  I'm locally forwarding tcp445 over the ssh connection to the server and then mount something like so: mount -t cifs //localhost/share /mountpoint

With bare samba (no ssh) the time it takes to move the file is 1 minute, 20 seconds.

With samba over the ssh it takes about 17 minutes.

When I just do an scp of the same file it takes about 2 minutes.

At no point in any of the above transfers does either system appear to be pinned out, cpuwise.

Why would samba-over-ssh be taking so much longer?  Anyone else care to post times/benchmarks between some of these?

----------

## Antek Grzymala

 *terminallymortal wrote:*   

> Why would samba-over-ssh be taking so much longer?  Anyone else care to post times/benchmarks between some of these?

 

I won't help you with posting any benchmarks, but suspect it's an obscure TCP/UDP windowsize/retransmission/fragmentation/whatever problem. However I would suggest that you use OpenVPN for setting up a secure tunnel to your remote server, I'm using it and get very decent performance for mounted Samba shares over this tunnel.

It's very simple to setup in a basic static-key configuration.

[a]

----------

## feld

samba over ssh is slower because of the huge overhead, simply put.

----------

## terminallymortal

The overhead of what exactly feld?  Samba alone is somewhat close to scp alone, so I don't understand what is adding "overhead"?

I have to lean towards what Antek said about some tcp parameter being wonky...

----------

