poor samba performance

2012-06-01

If you have google’d for smb.conf settings to max your 1Gb (or 10Gb) ethernet based network and you still cannot seem to get beyond 30MB/sec, make sure you have this option:

socket options = SO_RCVBUF=8192 SO_SNDBUF=8192

Either commented it out, or set the buffer size to 128K (131072). Or larger.

I was helping a friend of mine troubleshoot his ZFS + Samba environment.

He was running FreeBSD 9.0 and Samba 3.5 and he had followed my previous guidelines on tuning Samba for FreeBSD

I was so used to these settings just working that I started to question his switch.

So, I ran iperf on his Windows 7 desktop and on his FreeBSD server. He got 980Mbit/sec

Finally, after carefully scrutinizing his smb.conf file, I saw the socket options = SO_RCVBUF… line and hypothesized that was the culprit.

After commenting it out and restarting Samba, his desktop went from 30MB/sec (both reads and writes) to 100MB/sec for reads and about 90MB/sec for writes to his Samba share.

Now his backups complete 3x faster than before.