Samba Socket Options

Status
Not open for further replies.

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
It seems like almost every website I've seen recommends various tweaks to the "socket options" parameter in Samba. Samba defaults to socket options = TCP_NODELAY.

Here are some common socket options websites recommend:
  • TCP_NODELAY - disables Nagle's algorithm default in Samba.
  • IPTOS_LOWDELAY, IPTOS_THROUGHPUT - sets the Type of Service (TOS) byte in the IPv4 header to 0x10 and 0x08. It is a layer 3 QOS option for IPv4 traffic. This means typical home users will see no benefit because their samba traffic will not be passing through routers.
  • SO_SNDBUF, SO_RCVBUF - these modify the send and receive buffers. If you need to tune your send and receive buffers, you do it through tunables / allowing the FreeBSD kernel to automatically adjust appropriate send and receive buffers (after reading the relevant documentation). Tuning is - I believe -currently recommended for 10 gigabit networking. There are various posts regarding appropriate parameters, but I won't repeat here because they are (I believe) specific to certain 10 gigabit cards. That said, hard-coding buffer values in Samba is not a good way to do this.
 
Last edited:

Philip Robar

Contributor
Joined
Jun 10, 2014
Messages
116
The problem with any type of system tuning is that the recommendations become obsolete as improvements, fixes and changes to default settings are made. Much of the SMB tuning advice found on the Internet is for older versions and may in fact degrade performance on newer versions, but unfortunately authors are not always careful to point out which versions their changes are relevant to, nor do they often update their posts.

Here's a FreeNAS bug filed in 2017 that has been updated within a month of this comment that discusses SMB tuning for FreeNAS/ZFS: https://bugs.freenas.org/issues/24210
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
The problem with any type of system tuning is that the recommendations become obsolete as improvements, fixes and changes to default settings are made. Much of the SMB tuning advice found on the Internet is for older versions and may in fact degrade performance on newer versions, but unfortunately authors are not always careful to point out which versions their changes are relevant to, nor do they often update their posts.

Here's a FreeNAS bug filed in 2017 that has been updated within a month of this comment that discusses SMB tuning for FreeNAS/ZFS: https://bugs.freenas.org/issues/24210

I'm somewhat aware of the bug ticket since I was one of the people commenting in the ticket. :)

No special tuning is required.

FYI, members of the samba project have repeatedly called this stuff out as 'pure voodoo'. JRA even commented once that he wishes he could just rip out the 'socket options' parameter.
 
Status
Not open for further replies.
Top