Samba performance tweeks


Recommended Posts

I was looking at the samba settings that come with UnRaid.  They do not match what is "recommeded" for max performance.  Some of the differences are:

 

SO_RCVBUF and SO_SNDBUF are recommended to be 8kB looks like we have 4kB.

read raw and write raw are also recommended and I don't see those at all.

 

 

What about setting MTU size or is that set elsewhere?  My network can handle jumbo packets.

 

I'm hesitant to change the settings as I don't know if UnRaid requires these settings in order to work.  Has anyone changed any of these?

 

thanks,

 

Link to comment

Actually, SO_RCVBUF and SO_SNDBUF are both set to 65535.  Last time we worked on Samba performance, found these were the optimal settings.  Also, 'read raw' and 'write raw' are set to 'Yes' by default.

 

MTU settings can be changed by the 'ifconfig' command.  Again, last time we were trying to improve ethernet performance, didn't find much improvement going to larger frames, even with jumbo-frame-supported switches.  Turns out there's a lot of tweaking to do, both on linux side and windows side to wring out better performance.  Maybe one of our community members can experiment a bit with this?  ;)

Link to comment

Actually, SO_RCVBUF and SO_SNDBUF are both set to 65535.  Last time we worked on Samba performance, found these were the optimal settings.  Also, 'read raw' and 'write raw' are set to 'Yes' by default.

 

MTU settings can be changed by the 'ifconfig' command.  Again, last time we were trying to improve ethernet performance, didn't find much improvement going to larger frames, even with jumbo-frame-supported switches.  Turns out there's a lot of tweaking to do, both on linux side and windows side to wring out better performance.  Maybe one of our community members can experiment a bit with this?  ;)

Tom,  I looked in /etc/samba/smb.conf on my server and it looks like SO_RCVBUF and SO_SNDBUF are not both set to 65535.

 

The line in my config file set them like this SO_RCVBUF=66535 SO_SNDBUF=65535

 

Could this be a typo and you intended to enter 65535 instead of 66535 for SO_RVCBUF? 

Might it work better with the 65535 you might have intended as the receive buffer size?

 

Joe L.

 

Contents of /etc/samba/smb.conf follow:

root@Tower:/etc/samba# cat smb.conf
[global]
        # configurable identification
        include = /etc/samba/smb.names
        log level = 1
        log file = /var/log/samba.%m
        max log size = 2000
        socket options = TCP_NODELAY SO_KEEPALIVE SO_RCVBUF=66535 SO_SNDBUF=65535
        disable spoolss = Yes
        show add printer wizard = No
        security = SHARE
        guest account = root
        guest ok = Yes
        guest only = Yes
        read only = No
        map archive = Yes
        map system = Yes
        map hidden = Yes
[flash]
        path = /boot

# auto-configured shares
include = /etc/samba/smb.shares

Link to comment

Yep that's a typo, but in practice, it's essentially equivalent.

 

For a good read on this subject, refer to the following:

http://www.psc.edu/networking/projects/tcptune

http://www.redhawk.org/print.php?sid=39

 

An "unknown" for me at the moment is to what extent Samba fiddles with socket options - probably will have to study the Samba code to understand this before making tcp tuning decisions.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.