Speed up SMB (Samba) server performance

Mar 30, '04 10:12:00AM

Contributed by: MartySells

With Apple's awesome support for software RAID, my main fileserver is now on an OS X box (sometimes even my iBook!). I occasionally notice big latency when opening directories or saving files from a Windows box via SMB. After some investigation, I found that tuning Samba a little has greatly improved this. Put the following in the [global] section of /etc/smb.conf:

  read size = 1024<br>
  socket options = TCP_NODELAY SO_KEEPALIVE
   SO_RCVBUF=2048 SO_SNDBUF=2048 IPTOS_LOWDELAY<br>
  getwd cache = yes<br>
Note: The socket options entry is shown on two lines; enter it as one long line. And, of course, restart smbd with a -HUP> signal or your prefered method when you're done editing.

The most important change, I'm guessing, is read size. This controls how Samba buffers data between the disk and the network. I can't promise that these settings will be faster in all cases, but things are definately better for me (server: iBook w/ software RAID on Firewire 400) for lag. My boss in Australia (server: Linux, hardware ATA RAID) reports that his disk throughput on the server with the new configuration is 3% to 17% faster (ran a few tests) when copying a 200mb file.

Comments (7)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20040324053434397