Make samba fast

Samba’s default settings are defined with security and compatibility in mind. In the modern world, we can trade off compatibility and some security for faster speed.

Options to put in smbd.conf:

socket options = IPTOS_LOWDELAY TCP_NODELAY IPTOS_THROUGHPUT SO_RCVBUF=131072 SO_SNDBUF=131072
deadtime = 30
use sendfile = yes
case sensitive = yes
default case = lower
preserve case = yes
short preserve case = yes
aio read size = 16384
aio write size = 16384
server multi channel support = yes

As a bonus, we may as well turn off name mangling and map illegal characters to some rarely used ones, to get more beautiful filenames.

mangled names = no
vfs objects = catia
catia:mappings = 0x22:0xa8,0x2a:0xa4,0x2f:0xf8,0x3a:0xf7,0x3c:0xab,0x3e:0xbb,0x3f:0xbf,0x5c:0xff,0x7c:0xa6

Also consider switching over to ksmbd if you don’t need advanced features for your shares.


Posted

in

,

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *