The next thing to look at are the
socket
options
configuration options. These are really host system tuning options, but they're set on a per-connection basis, and can be reset by Samba on the sockets it employs by adding
socket
options
=
option
to the
[global]
section of your
smb.conf file. Not all of these options are supported by all vendors; check your vendor's manual pages on
setsockopt (1) or
socket (5) for details.
The main options are:
-
TCP_NODELAY
-
Have the server send as many packets as necessary to keep delay low. This is used on telnet connections to give good response time, and is used - somewhat counter-intuitively - to get good speed even when doing small requests or when acknowledgments are delayed (as seems to occur with Microsoft TCP/IP). This is worth a 30-50 percent speedup by itself. Incidentally, in Samba 2.0.4,
socket
options
=
TCP_NODELAY
became the default value for that option.
-
IPTOS_LOWDELAY
-
This is another option that trades off throughput for lower delay, but which affects routers and other systems, not the server. All the IPTOS options are new; they're not supported by all operating systems and routers. If they are supported, set
IPTOS_LOWDELAY
whenever you set
TCP_NODELAY
.
-
SO_SNDBUF
and
SO_RCVBUF
-
The send and receive buffers can often be the reset to a value higher than that of the operating system. This yields a marginal increase of speed (until it reaches a point of diminishing returns).
-
SO_KEEPALIVE
-
This initiates a periodic (four-hour) check to see if the client has disappeared. Expired connections are addressed somewhat better with Samba's
keepalive
and
dead
time
options. All three eventually arrange to close dead connections, returning unused memory and process-table entries to the operating system.
There are several other socket options you might look at, (e.g.,
SO_SNDLOWAT
), but they vary in availability from vendor to vendor. You probably want to look at
TCP/IP Illustrated if you're interested in exploring more of these options for performance tuning with Samba.