Last Updated: February 25, 2016
·
18.58K
· ioquatix

Fix Samba read and write performance issues.

I first noticed performance issues on my Mac 10.9 (Mavericks) when accessing a Samba4 (smbd/nmbd/samba) server on linux. After investigating this issue, I found that the most important thing to do was increase the size of the buffers on the server.

Initial performance via GigE:

# dd if=/dev/zero of=net/zero.bin bs=10M count=5
52428800 bytes (52 MB) copied, 3.88251 s, 13.5 MB/s

I added the following to smb.conf in the global section:

# Socket buffers should be huge:
  socket options = IPTOS_LOWDELAY TCP_NODELAY SO_RCVBUF=65536 SO_SNDBUF=65536
# Use sendfile for reading files efficiently:
  use sendfile = yes
# Cache data before flushing to disk:
  write cache size = 2097152
  min receivefile size = 16384
  getwd cache = true

After:

# dd if=/dev/zero of=net/zero.bin bs=10M count=5
52428800 bytes (52 MB) copied, 0.473838 s, 111 MB/s

Completely saturate the GigE link (maximum theoretical throughput ~125 MB/s).

1 Response
Add your response

On my MacBook Pro (Retina), running 10.9 (Mavericks), I had the following improvement:

^_^ > time cp data.bin /Volumes/samuel/data.bin 
cp data.bin /Volumes/samuel/data.bin  0.00s user 0.15s system 0% cpu 1:57.14 total
^_^ > time cp data.bin /Volumes/samuel/data.bin
cp data.bin /Volumes/samuel/data.bin  0.00s user 0.10s system 0% cpu 15.959 total
over 1 year ago ·