The arrow of time

Ivan Voras' blog

Magical incantations for Samba

Judging from the frequency of discussions on the mailing lists, Samba is notoriously difficult to tune for FreeBSD. I decided to play a little on a platform where every bit of performance helps, an embedded Geode-based computer, with some good results.

Before tuning, I was able to achieve 6-7 MB/s in either direction. I've then upgraded from default samba to samba 3.2 (newsflash: samba33 is in the ports!) and after some trial and error fiddling with the config file settled on these lines:

socket options=SO_RCVBUF=131072 SO_SNDBUF=131072 TCP_NODELAY
min receivefile size=16384
use sendfile=true

Simply installing samba32 isn't enough. Apparently something is wrong with either the documentation or the implementation of the "min receivefile size" option - larger values result in worse performance.

With the above settings I can now receive files on the machine at about 9.3 MB/s  (which nearly saturates this slow machine) and serve them to clients at around 7.5 MB/s (both results are for big files). I have no idea why sending is that much slower. Increasing vfs.readmax doesn't help.

#1 Re: Magical incantations for Samba

Added on 2009-03-09T10:48 by pepe

Hi, have you also tried smb3.3? If you did, what is the result?

#2 Re: Magical incantations for Samba

Added on 2009-03-11T01:15 by Ivan Voras

Just tried samba33 (it's in the ports!). It looks like there could be a slight improvement but it's inconsistent - perhaps a few hundred kB/s at most, which is within measurement uncertainty for this machine.

#3 Re: Magical incantations for Samba

Added on 2009-03-11T01:22 by Ivan Voras

It looks like a few hundred more kB/s can be wrought from Samba it by using AIO. I used these settings:

aio read size = 16384
aio write size = 16384
aio write behind = true

(don't forget to load the AIO kernel module)

#4 Re: Magical incantations for Samba

Added on 2009-03-15T02:00 by Ooga Chaka

A different area to optimize but any tests comparisons on using tdbsam versus ldap to store uids?

#5 Re: Magical incantations for Samba

Added on 2009-03-15T02:08 by Ivan Voras

No, I have no need to test Samba on hundreds or thousands of users :)

Post your comment here!

Your name:
Comment title:
Text:
Type "xxx" here:

Comments are subject to moderation and will be deleted if deemed inappropriate. All content is © Ivan Voras. Comments are owned by their authors... who agree to basically surrender all rights by publishing them here :)