Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 26 Feb 2014 23:40:55 +0000
From:      Radu Coroi <coroi_test@yahoo.com>
To:        freebsd-questions@freebsd.org
Subject:   slow samba performance even after tuning
Message-ID:  <824D454A-F316-44AD-B39E-55E85396FEF1@yahoo.com>

next in thread | raw e-mail | index | archive | help
Hi all,
My home server is a HP Microserver N40L (spec at =
http://n40l.wikia.com/wiki/Base_Hardware_N40L) with 6GB of RAM running =
freebsd 10.0 installed on a flash drive.

Unfortunately the samba performance is quite bad sitting at 40MBps where =
NFS is at 70MBps and 106MBps for FTP on the same test file at 1.5GB on =
top of one ZFS file. The poor performance doesn't allow for a full hd =
playback.

I've tried both samba36 and samba41 and AIO and applied the =
recommendations from the =
http://lists.freebsd.org/pipermail/freebsd-stable/2011-February/061642.htm=
l but still the same results.

In the same time smbd process cpu usage never goes above 15% like it is =
somehow not getting enough priority and not sure if this is due to a =
missing parameter or the fact that is running from the flash drive.

I have the following additions :
[radu@hp ~]$ cat /boot/loader.conf=20
# We use Samba built with AIO support; we need this module!
aio_load=3D"yes"

geom_journal_load=3D"YES"

kern.maxfiles=3D"25000"

# Set TXG write limit to a lower threshold.  This helps "level out"
# the throughput rate (see "zpool iostat").  A value of 256MB works well
# for systems with 4 GB of RAM, while 1 GB works well for us w/ 8 GB on=20=

# disks which have 64 MB cache. <<BR>>

# NOTE: in <v28, this tunable is called =
'vfs.zfs.txg.write_limit_override'.
vfs.zfs.write_limit_override=3D792723456

$ cat /etc/sysctl.conf=20
# $FreeBSD: release/10.0.0/etc/sysctl.conf 112200 2003-03-13 18:43:50Z =
mux $
#
#  This file is read when going to multi-user and its contents piped =
thru
#  ``sysctl'' to adjust kernel values.  ``man 5 sysctl.conf'' for =
details.
#

# Uncomment this to prevent users from seeing information about =
processes that
# are being run under another UID.
#security.bsd.see_other_uids=3D0

vfs.zfs.prefetch_disable=3D1

# Increase send/receive buffer maximums from 256KB to 16MB.
# FreeBSD 7.x and later will auto-tune the size, but only up to the max.
net.inet.tcp.sendbuf_max=3D16777216
net.inet.tcp.recvbuf_max=3D16777216

# Double send/receive TCP datagram memory allocation.  This defines the
# amount of memory taken up by default *per socket*.
net.inet.tcp.sendspace=3D65536
net.inet.tcp.recvspace=3D131072

In /usr/local/etc/smb.conf
....
  socket options =3D TCP_NODELAY SO_SNDBUF=3D131072 SO_RCVBUF=3D131072
  use sendfile =3D no
  min receivefile size =3D 16384
  aio read size =3D 16384
  aio write size =3D 16384
  aio write behind =3D yes

Please help me tune the samba so I can match most of the NFS performance =
so I can use it for watching full hd movies.

Thank you very much,
Radu






Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?824D454A-F316-44AD-B39E-55E85396FEF1>