Samba speeds

Soldato
Joined
15 Feb 2003
Posts
10,140
Location
Europe
If samba just horrendous when copying files or is it just my set-up?

Trying copy a 3gb file from my macbook (wifi n) to my ubuntu desktop, and it's estimated at taking 4 hours.

It's a similar time when using my router as the file server isn't of the ubuntu box.

Oddly I can download the file via wifi in much less than half the time.
 
Definitely something about your setup - I just ran a test and pulled a 3.19GB file (Windows 8 ISO) from my home server to my PC over Gigabit Ethernet

The copy took ~30 seconds and was almost rock solid at 112MB/s apart from a couple of seconds where it dipped to 106MB/s. This isn't far off the theoretical gigabit ethernet maximum throughput (of 125MB/s).

That's probably pretty much a best-case scenario, copying from a fairly fast HDD, to an SSD, through a single switch over about 3m of Cat5e - but it certainly shows that Samba isn't introducing any significant bottleneck, even if we assume that my HDD, SSD, OS at either end, switch and Gigabit Ethernet are introducing absolutely no losses, the Samba overhead must be an absolute maximum of 10.4%
 
Check the raw network performance between the machines with iperf then divide the Mb/ by 8 to give you the theoretical max transfer rate.

You should see within 10% of this figure for file transfers
 
This is what I got over wifi.

It looks decent to me for wifi N.

Code:
------------------------------------------------------------
Client connecting to 192.168.1.69, TCP port 5001
TCP window size:  129 KByte (default)
------------------------------------------------------------
[  4] local 192.168.1.64 port 54853 connected with 192.168.1.69 port 5001
[ ID] Interval       Transfer     Bandwidth
[  4]  0.0-10.0 sec  76.2 MBytes  63.8 Mbits/sec

Presumably that means there is a samba setup problem.
 
63.8Mbit/s equates to roughly 8MB/s. Knock 10% off for samba over head and I'd expect just over 7MB/s transfer rates.

So taking that a 3.19GB file you should be looking at around 7.5 minutes for it to transfer.

I'd suggest trying either NFS, SCP or rsync and see if it's quicker.
 
Last edited:
I used to have slow transfers, after much google-fu it was down to the send and receive buffers being too low.

in /etc/smb.conf [global] i added
socket options = TCP_NODELAY IPTOS_LOWDELAY SO_KEEPALIVE SO_RCVBUF=65535 SO_SNDBUF=65535
 
Not great considering the theoretical max is 150Mbit but even then you'd only expect 17MB/s


Tbh if I needed to transfer files and I was that close to the router I'd just throw a cable in.

I consistently get 105-112MB/s between my Home Server (Debian) and my desktop (Linux Mint)
 
Ah I got my Mb and MB mixed up there. So for wifi n considering the router is only 2 meters away 63Mb/s is actually terribly poor.

Wifi is a convenience and really isn't the best tool for moving large files. Try changing the wifi channel in case it's some kind of congestion locally but in fairness, in the length of times it's probably taken you to write the OP and read the responses, you probably could have thrown a cable in and copied the file.
 
Wifi is a convenience and really isn't the best tool for moving large files. Try changing the wifi channel in case it's some kind of congestion locally but in fairness, in the length of times it's probably taken you to write the OP and read the responses, you probably could have thrown a cable in and copied the file.

That wouldn't be easy. The device doesn't have an ethernet port. I'd have to order a thunderbolt to ethernet adapter, which would arrive in a couple of days. Royal Mail - great bandwidth, terrible latency :D
 
Not great considering the theoretical max is 150Mbit but even then you'd only expect 17MB/s


Tbh if I needed to transfer files and I was that close to the router I'd just throw a cable in.

I consistently get 105-112MB/s between my Home Server (Debian) and my desktop (Linux Mint)


That depends on your router - 802.11N can be up to 450Mbit/s (~56MB/s) if you're using 3x3. Most devices use 2x2, but that's still 300Mbit/s or ~37-38MB/s. Assuming I didn't miss somewhere the OP mentioned it was a 150Mbit router.
 
Back
Top Bottom