Samba Performace

By steve, 12 March, 2016

I have had issues for a while with upload speed to our samba server. I was able to download at ~70MB/s, but upload at only 7MB/s. From memory, I fixed the download speed by setting a bunch of settings, but uploads remained slow.

Tracing the issue led me to do a strace on the smbd process, which showed 1460 bytes being written every 0.2ms, with the read() and write() system calls using all the time. The end solution was to set the following option in /setc/samba/smb.conf

socket options = TCP_NODELAY

This causes all TCP packets to be acknowledged immediately, which allowed both uploads and downloads to happen at 112MB/s.

The previous settings for the above option was as follows (based on advice from the internet):


socket options = IPTOS_LOWDELAY TCP_NODELAY SO_SNDBUF=4096 SO_RCVBUF=4096

Other options that I do have set in the global section of the samba config file are as follows (just in case they also help improve performance)

read raw = Yes
write raw = Yes
min receivefile size = 16384
use sendfile = true
aio read size = 16384
aio write size = 16384
strict allocate = yes

Tags

Comments