FreeBSD 8-Stable with Samba too slow

Jeremy Chadwick freebsd at jdc.parodius.com
Fri Feb 5 15:08:19 UTC 2010


On Fri, Feb 05, 2010 at 03:41:42PM +0100, Johan Hendriks wrote:
> >Hi all,
> 
> >I have just installed FreeBSD 8.0-STABLE-201001 to work as a file
> server
> >running samba 3.3.9 installed by ports.
> >But, I don't know why, when I try to access the share by Windows or by
> >Linux, it is so slow. I takes a long time to give the authentication
> window
> >and when I manage authenticate It keeps so slow to browse directories
> and
> >files. And the interesting thing is that when I reach the share with my
> >files (*.iso for tests) after a long time and start a copy, the
> transfer
> >goes so good, in a normal gigabit speed.
> 
> >I tried compiling and installing samba 3.4.5 and had the same behaviour
> .
> >Maybe it's not a samba issue.
> 
> >I already have two freebsd file servers both with the 8-RELEASE version
> and
> >they're running ok!
> >In this case, I need to use the 8-STABLE version because of my disk
> >controller. So I don't know what could be happening.
> 
> 
> >Thanks in advance!
> 
> Just a me too!
> 
> I had a 8.0 RELEASE server running on a HP Proliant ML110.
> The server responded quick wit no issues at all.
> I just upgraded the server to 8-Stable (No reason, just test) and the
> samba speed drops significant.
> Normally little files did not show the copy box, but after the update
> all copy's to the XP desktop shows me the copy window in windows.
> 
> Same kernel file and settings.
> Samba version is 3.3.9

I'm using Samba at home on FreeBSD 8.0-STABLE for personal use
(user-level shares, and the guest OS is Windows XP).  I've spent quite
some time tuning both FreeBSD sysctls as well as smb.conf to try and get
the most overall throughput.  What I ended up with is this:

sysctl.conf --

net.inet.tcp.sendbuf_max=16777216
net.inet.tcp.recvbuf_max=16777216
net.inet.tcp.sendspace=65536
net.inet.tcp.recvspace=131072

smb.conf --

socket options = TCP_NODELAY SO_SNDBUF=65536 SO_RCVBUF=65536
read raw = yes
use sendfile = yes


I tried adjusting many of the above parameters to try and find a "sweet
spot" for reading/writing data to a 2-disk ZFS mirror (2x1TB disks,
7200rpm, SATA2 connected via ICH9 with AHCI enabled, and using
ataahci(4) (not ahci(4)).  The above is what works best.

"Worked best" means I can push about 40-50MBytes/sec reading/writing
to/from a Samba SMB/CIFS share.  Comparatively, FTP gets around
75-85MByte/sec with the same sysctl.conf configuration.

This is using Samba 3.3.10, though I can guarantee I saw the same
speed/throughout as a result of the above tuning going back to 3.3.7.

-- 
| Jeremy Chadwick                                   jdc at parodius.com |
| Parodius Networking                       http://www.parodius.com/ |
| UNIX Systems Administrator                  Mountain View, CA, USA |
| Making life hard for others since 1977.              PGP: 4BD6C0CB |



More information about the freebsd-stable mailing list