<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>My Wushu Blog &#187; Samba</title>
	<atom:link href="http://www.mywushublog.com/tag/samba/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mywushublog.com</link>
	<description></description>
	<lastBuildDate>Wed, 28 Jul 2010 05:05:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>FreeBSD 8.0 = A Great NAS Server</title>
		<link>http://www.mywushublog.com/2009/12/freebsd-8-0-a-great-nas-server/</link>
		<comments>http://www.mywushublog.com/2009/12/freebsd-8-0-a-great-nas-server/#comments</comments>
		<pubDate>Wed, 23 Dec 2009 04:30:23 +0000</pubDate>
		<dc:creator>mike</dc:creator>
				<category><![CDATA[Geekyness]]></category>
		<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[kickassery]]></category>
		<category><![CDATA[Samba]]></category>
		<category><![CDATA[ZFS]]></category>

		<guid isPermaLink="false">http://www.mywushublog.com/?p=646</guid>
		<description><![CDATA[I need to share this. When I google for &#8220;Samba performance&#8221;, I never see real numbers, real configuration files, or real hardware environments. All I read are anecdotal recollections, and that is not good enough. I like numbers, and I&#8217;ll let the numbers speak for themselves: &#62; netstat -I em0 -w 1 input (em0) output [...]]]></description>
			<content:encoded><![CDATA[<p>I need to share this. When I google for &#8220;Samba performance&#8221;, I never see real numbers, real configuration files, or real hardware environments. All I read are anecdotal recollections, and that is not good enough. I like numbers, and I&#8217;ll let the numbers speak for themselves:</p>
<pre>    &gt; netstat -I em0 -w 1
                input          (em0)           output
       packets  errs      bytes    packets  errs      bytes colls
         90166     0   98762637      95363     0    5332847     0
         18131     0   24713156      20042     0    1123684     0
             4     0        310          1     0        178     0
             8     0        518          1     0        178     0
         10153     0   10952920      10696     0     598129     0
         92990     0  102837002      98476     0    5514994     0
         92025     0  102680574      97277     0    5439496     0
         92080     0  101799874      97403     0    5448637     0
         75348     0   90861608      80972     0    4537737     0
         90895     0  100323946      95781     0    5360948     0
         89313     0   97371154      94364     0    5278618     0
         81363     0   89229738      85861     0    4803589     0
             2     0        126          3     0        286     0</pre>
<p>I was so shocked that I had to use gstat and zpool iostat to verify the information:</p>
<pre>    dT: 1.002s  w: 1.000s  filter: da0
     L(q)  ops/s    r/s   kBps   ms/r    w/s   kBps   ms/w   %busy Name
       35   1476      0      0    0.0   1476 188421   23.7  100.0| da0

    &gt; zpool iostat  1
                   capacity     operations    bandwidth
    pool         used  avail   read  write   read  write
    ----------  -----  -----  -----  -----  -----  -----
    tank        5.68T  4.32T      1     81   250K  10.1M
    tank        5.68T  4.32T      0  1.37K      0   175M
    tank        5.68T  4.32T      0  1.44K      0   184M
    tank        5.68T  4.32T      0  1.44K      0   184M
    tank        5.68T  4.32T      0  1.44K      0   184M
    tank        5.68T  4.32T      0  1.44K      0   184M
    tank        5.68T  4.32T      0  1.44K      0   184M
    tank        5.68T  4.32T      0  1.44K      0   184M</pre>
<p>This is all through Samba (3.3.9), There was no local work being done. I unfortunately didn&#8217;t configure MRTG correctly, so it had built a malformed graph while all this happened. Having a picture from all of this would have been nice.</p>
<p>The underlying storage is a SATABoy2 RAID6 array, with a simple &#8220;flat&#8221; ZFS filesystem (version 13). As cheap as the SATABoy&#8217;s are (and come on, they have a terrible IIS web interface), they can at least keep up with the current load.</p>
<p>I have felt that if you are going to use ZFS, you should let it manage the RAID, and not bother with a hardware RAID controller. While the hardware RAID may be faster, ZFS&#8217;s ability to self-correct bad blocks is a great feature despite the performance set back. However, RAID6 is pretty good in itself, and having dual parity would ideally reduce the risk of a bad block being detrimental.</p>
<p>One thing I noticed with Samba is it doesn&#8217;t seem to be a threaded daemon. When I do a top(1) -H, there are only 2-3 smbd processes, and one of them is running around 30%. Though I don&#8217;t really know how well Samba can scale out, this environment only has about 10 users. I would like to see how samba reacts if there are a couple hundred active users. Furthermore, how does a native Windows server handle a couple hundred users? It may handle it a little better, however, I don&#8217;t think I would enjoy watching NTFS handling a multi-terabyte volume&#8230; it would be like watching a stroke victim eat a bowl of soup. I do admit I am biased and I have no working experience with Windows as a large file server, most of them that I have worked on are horribly limited and underpowered, and no one seems to care if they perform well or not.</p>
<h3>Hardware</h3>
<h4>CPU information</h4>
<pre>    Machine class:    amd64
    CPU Model:    Dual Core AMD Opteron(tm) Processor 285
    No. of Cores:    4
    Cores per CPU:</pre>
<h4>RAM information</h4>
<pre>    Memory information from dmidecode(8)
    Maximum Capacity: 8 GB
    Number Of Devices: 4
    Maximum Capacity: 8 GB
    Number Of Devices: 4

    INFO: Run `dmidecode -t memory` to see further information.

    System memory summary
    Total real memory available:    8048 MB
    Logically used memory:        2876 MB
    Logically available memory:    5172 MB

    Swap information
    Device          1K-blocks     Used    Avail Capacity
    /dev/da1s1b       8373844      28K     8.0G     0%</pre>
<h4>Storage information</h4>
<pre>    Available hard drives:
    cd0:  Removable CD-ROM SCSI-0 device
    cd0: 1.000MB/s transfers
    da2:  Fixed Direct Access SCSI-5 device
    da2: 300.000MB/s transfers
    da2: Command Queueing enabled
    da2: 140009MB (286739329 512 byte sectors: 255H 63S/T 17848C)
    da1:  Fixed Direct Access SCSI-2 device
    da1: 300.000MB/s transfers
    da1: Command Queueing enabled
    da1: 69618MB (142577664 512 byte sectors: 255H 63S/T 8875C)
    da0:  Fixed Direct Access SCSI-5 device
    da0: 200.000MB/s transfers
    da0: Command Queueing enabled
    da0: 10491861MB (21487333120 512 byte sectors: 255H 63S/T 1337524C)

    Raid controllers:
    umass-sim0:
    mpt0:
    vendor='LSI Logic (Was: Symbios Logic, NCR)'
    device='SAS 3000 series, 4-port with 1064 -StorPort'
    isp0:
    vendor='QLogic Corporation'
    device='QLA6322 Fibre Channel Adapter'

    Currently mounted filesystems:
    /dev/da1s1a on /
    devfs on /dev
    tank on /tank
    /dev/ufs/EXPORT on /export

    I/O statistics:
           tty             da0              da1              da2             cpu
     tin  tout  KB/t tps  MB/s   KB/t tps  MB/s   KB/t tps  MB/s  us ni sy in id
       0    40 63.61 167 10.36  16.53   2  0.03  61.65   0  0.00   1  0  4  0 94
    INFO: Run iostat(8) or gstat(8) to see live statistics.

    Disk usage:
    Filesystem         Size    Used   Avail Capacity  Mounted on
    /dev/da1s1a         58G    3.4G     50G     6%    /
    devfs              1.0K    1.0K      0B   100%    /dev
    tank               9.8T    5.7T    4.1T    58%    /tank
    /dev/ufs/EXPORT    126G    148K    116G     0%    /export</pre>
<h3>Software</h3>
<ul>
<li>FreeBSD 8.0-RELEASE-p1 FreeBSD 8.0-RELEASE-p1 amd64</li>
<li>samba-3.3.9         A free SMB and CIFS client and server for UNIX</li>
</ul>
<h4>Samba 3.3.9 Compile-Time Config</h4>
<pre>&gt; make showconfig
===&gt; The following configuration options are available for samba-3.3.9:
     LDAP=on "With LDAP support"
     ADS=on "With Active Directory support"
     CUPS=off "With CUPS printing support"
     WINBIND=on "With WinBIND support"
     SWAT=off "With SWAT WebGUI"
     ACL_SUPPORT=on "With ACL support"
     AIO_SUPPORT=on "With Asyncronous IO support"
     FAM_SUPPORT=on "With File Alteration Monitor"
     SYSLOG=on "With Syslog support"
     QUOTAS=on "With Disk quota support"
     UTMP=off "With UTMP accounting support"
     PAM_SMBPASS=on "With PAM authentication vs passdb backends"
     DNSUPDATE=off "With dynamic DNS update(require ADS)"
     DNSSD=off "With DNS service discovery support"
     EXP_MODULES=on "With experimental modules"
     POPT=on "With system-wide POPT library"
     MAX_DEBUG=off "With maximum debugging"
     SMBTORTURE=off "With smbtorture"
===&gt; Use 'make config' to modify these settings</pre>
<h3>System Tuning</h3>
<h4>The Kernel</h4>
<p>I enabled device polling, and took out debugging in the kernel (Sanders, get it! Mmm, I&#8217;m hungry&#8230;)</p>
<pre>diff /usr/src/sys/amd64/conf/GENERIC /usr/src/sys/amd64/conf/SANDERS
    33d32
    &lt; makeoptions    DEBUG=-g        # Build kernel with gdb(1) debug symbols
    78c77
    &lt;
    ---
    &gt; options        DEVICE_POLLING</pre>
<h4>/boot/loader.conf</h4>
<pre>    ispfw_load="YES"
    kern.hz="2000"
    aio_load="YES"</pre>
<h4>/etc/sysctl.conf</h4>
<pre>    kern.coredump=0
    security.bsd.see_other_uids=0
    security.bsd.see_other_gids=0
    kern.ipc.maxsockbuf=16777216
    kern.ipc.nmbclusters=32768
    kern.ipc.somaxconn=32768
    kern.maxfiles=65536
    kern.maxfilesperproc=32768
    kern.maxvnodes=800000
    net.inet.tcp.delayed_ack=0
    net.inet.tcp.inflight.enable=0
    net.inet.tcp.path_mtu_discovery=0
    net.inet.tcp.recvbuf_auto=1
    net.inet.tcp.recvbuf_inc=524288
    net.inet.tcp.recvbuf_max=16777216
    net.inet.tcp.recvspace=65536
    net.inet.tcp.sendbuf_auto=1
    net.inet.tcp.sendbuf_inc=524288
    net.inet.tcp.sendspace=65536
    net.inet.udp.maxdgram=57344
    net.inet.udp.recvspace=65536
    net.local.stream.recvspace=65536
    net.inet.tcp.sendbuf_max=16777216
    net.inet.tcp.mssdflt=9142</pre>
<h4>rc.conf (em0 flags)</h4>
<p>I want to thank Zilla (see post comments) for the sysctl.conf help.</p>
<pre>    ifconfig_em0="inet xxx.xxx.xxx.xxx  netmask 255.255.255.0 polling tso mtu 9194"</pre>
<h4>smb.conf</h4>
<pre>        min receivefile size = 131072
        aio read size = 1
        aio write size = 1
        use sendfile = yes
        lock directory = /var/run/samba/
        keepalive = 300</pre>
<p>I&#8217;m also using LDAP users and group. I wasn&#8217;t sure if there would be a noticible performance hit for local users or LDAP users. There doesn&#8217;t seem to be one.</p>
<p>We use Active Directory, and since Quest/Vintela still won&#8217;t make a FreeBSD client for the Quest Authentication Servers ( a sales rep once told me &#8220;There are just too many versions of BSD&#8230;&#8221;) , I have to use all the open source utilities like OpenSSL, OpenLDAP Client and Kerberos. I don&#8217;t mind having to do it, but it is always nice if you can maintain one standard process across ALL systems, and we have a lot more Linux and Solaris systems than FreeBSD. I&#8217;m the odd one.</p>
<p>That aside, I use the latest OpenSSL in FreeBSD 8.0, OpenLDAP 2.4.20, and the built-in version of Heimdal Kerberos.</p>
<p>I get similar performance form NFS, however, most desktop users have are either on a Windows or OS X, and CIFS seems to be the unifying network storage protocol.</p>
<p>One thing I have yet to really figure out is configuring Samba to use proper NT ACL&#8217;s. However, if you can live with UNIX style permissions, a setup like this is pretty good at serving out lots and lots of data. Maybe that will be next.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mywushublog.com/2009/12/freebsd-8-0-a-great-nas-server/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Samba 3.0.28a vs 3.3.3 on FreeBSD 7.1</title>
		<link>http://www.mywushublog.com/2009/04/samba-3028a-vs-333-on-freebsd-71/</link>
		<comments>http://www.mywushublog.com/2009/04/samba-3028a-vs-333-on-freebsd-71/#comments</comments>
		<pubDate>Mon, 20 Apr 2009 05:30:58 +0000</pubDate>
		<dc:creator>mike</dc:creator>
				<category><![CDATA[Geekyness]]></category>
		<category><![CDATA[Benchmarking]]></category>
		<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[Samba]]></category>

		<guid isPermaLink="false">http://www.mywushublog.com/?p=319</guid>
		<description><![CDATA[!!! UPDATE on 12/29/2009!!! Since this blog post seems to get a good amount or hits from google, if you are reading this, please see my updated post: http://www.mywushublog.com/2009/12/freebsd-8-0-a-great-nas-server/ which has some additional information about FreeBSD 8.0 EOF Lately at work, I&#8217;ve been involved with a very large file system that is being export from [...]]]></description>
			<content:encoded><![CDATA[<p><strong>!!! UPDATE on 12/29/2009!!!</strong><br />
Since this blog post seems to get a good amount or hits from google, if you are reading this, please see my updated post: <a href="http://www.mywushublog.com/2009/12/freebsd-8-0-a-great-nas-server/">http://www.mywushublog.com/2009/12/freebsd-8-0-a-great-nas-server/</a> which has some additional information about FreeBSD 8.0<br />
<strong>EOF</strong></p>
<p>Lately at work, I&#8217;ve been involved with a very large file system that is being export from Solaris 10/ZFS to windows and OS X users via Samba. Even with a very large Sun server (T5220) a lot of users are complaining about the slow performance of the system. I&#8217;m not going to go into details, but what it has prompted me to do is to look into what I use at home (FreeBSD + Samba) for my network storage needs, and see if I can improve the performance of it.</p>
<p>Well, I was checking out the very useful <a href="http://ivoras.sharanet.org/freebsd/freebsd8.html"><em>Whats cooking for FreeBSD 8</em></a>, unrelated to my Samba needs, when I noticed this post on <a href="http://ivoras.sharanet.org/blog/tree/2009-03-06.magical-incantations-for-samba.html">Ivan Voras&#8217; blog</a>. Ivan has some really cool information there, and with this new knowledge I began my update from running Samba 3.0.28a,2 to 3.3.3,0 (the comma represents the Ports version).</p>
<p>Hvala Ivan!</p>
<p>I&#8217;ve discussed my new FreeBSD environment before <a href="http://www.mywushublog.com/2008/06/freebsd-70-zfs-and-iscsi/">here</a>, with that, here are some quick details:</p>
<ul>
<li>OS: FreeBSD 7.1</li>
<li>Intel Core 2 Duo E6750 (2.66Mhz 4MB cache)</li>
<li>Intel S975XBX2 workstation motherboard</li>
<li>AMCC 3Ware 9650SE 4 port SATA RAID controller (4x PCI-e)
<ul>
<li>BatterY backup for the 3Ware so I can enable cached writes</li>
</ul>
</li>
<li>2GB ECC Crucial Memory Kit</li>
<li>ASUS EN6200 LE 16x PCI-e nVidia GFX card</li>
<li>4 Western Digital 1TB Drives</li>
</ul>
<p>The 4 1TB drives create a nice 2.6TB (RAID5) array which I used Samba to share out to my 4 other systems in the house (which is a mix of Windows XP and Vista, sorry, no OS X). I do a lot with this array, any work that Michele and I do like photo editing, word documents, media files, etc.. all gets saved to this volume. Needless to say, this volume is accessed A LOT, and if the house ever caught on fire, I&#8217;d save the server before the family (Hey, I could still look at their pictures and videos&#8230;).</p>
<h3>The Old Configuration</h3>
<p><strong>samba 3.0.28a:</strong></p>
<pre>[root@server samba3]> make showconfig
===> The following configuration options are available for samba-3.0.34,1:
     LDAP=on "With LDAP support"
     ADS=on "With Active Directory support"
     CUPS=on "With CUPS printing support"
     WINBIND=on "With WinBIND support"
     ACL_SUPPORT=on "With ACL support
     AIO_SUPPORT=on "With Asyncronous IO support"
     FAM_SUPPORT=on "With File Alteration Monitor"
     SYSLOG=on "With Syslog support"
     QUOTAS=off "With Disk quota support"
     UTMP=on "With UTMP accounting support"
     PAM_SMBPASS=off "With PAM authentication vs passdb backends"
     CLUSTER=off "With experimental cluster support"
     DNSUPDATE=off "With dynamic DNS update(require ADS)"
     EXP_MODULES=off "With experimental modules"
     POPT=on "With system-wide POPT library"
     PCH=on "With precompiled headers optimization"
     MAX_DEBUG=off "With maximum debugging"
     SMBTORTURE=off "With smbtorture"
===> Use 'make config' to modify these settings</pre>
<h3>The New Configuration</h3>
<p><strong>samba 3.3 config:</strong></p>
<pre>[root@server samba33]&gt; make showconfig
===> The following configuration options are available for samba-3.3.3:
     LDAP=on "With LDAP support"
     ADS=off "With Active Directory support"
     CUPS=on "With CUPS printing support"
     WINBIND=on "With WinBIND support"
     SWAT=off "With SWAT WebGUI"
     ACL_SUPPORT=on "With ACL support"
     AIO_SUPPORT=on "With Asyncronous IO support"
     FAM_SUPPORT=off "With File Alteration Monitor"
     SYSLOG=off "With Syslog support"
     QUOTAS=off "With Disk quota support"
     UTMP=off "With UTMP accounting support"
     PAM_SMBPASS=on "With PAM authentication vs passdb backends"
     DNSUPDATE=off "With dynamic DNS update(require ADS)"
     DNSSD=off "With DNS service discovery support"
     EXP_MODULES=off "With experimental modules"
     SHARED_LIBS=off "With shared libraries"
     POPT=on "With system-wide POPT library"
     MAX_DEBUG=off "With maximum debugging"
     SMBTORTURE=off "With smbtorture"
===> Use 'make config' to modify these settings</pre>
<p>If you have never dealt with FreeBSD&#8217;s Ports system, setting these compile time options is a breeze with &#8216;make config&#8217;. These options are presented in a nurses interface (which is great for ssh or other terminal based sessions) like this:</p>
<div id="attachment_322" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.mywushublog.com/wp-content/uploads/2009/04/make-config.jpg"><img class="size-medium wp-image-322" title="make-config" src="http://www.mywushublog.com/wp-content/uploads/2009/04/make-config-300x197.jpg" alt="FreeBSD's make config screen" width="300" height="197" /></a><p class="wp-caption-text">FreeBSD&#39;s make config screen</p></div>
<p>The noticable options that I chose are <strong>AIO=yes</strong> and <strong>ADS=off</strong>. I&#8217;ve always compiled ADS support thinking that I would also get around to configuring Samba as an Active Directory-like server. But you know, there are really only two active users here, myself and Michele, and I don&#8217;t see the benefit right now. It could also slow down samba with the extra system calls so again, I&#8217;m leaving it out. AIO, Asyncronous IO, is new, and it is reported to increase size (oh wait, wrong advertisement) I mean, network IO.</p>
<h3>smb.conf options</h3>
<p>The performance related options in smb.conf are here:</p>
<pre>        socket options=SO_RCVBUF=131072 SO_SNDBUF=131072 TCP_NODELAY IPTOS_LOWDELAY
        min receivefile size=16384
        aio read size = 16384
        aio write size = 16384
        aio write behind = true
</pre>
<p>Again, I got these from Ivan&#8217;s post, plus what I&#8217;ve used for the past 8 years.</p>
<h3>Benchmarking with IOzone</h3>
<p>I ran a simple</p>
<pre>iozone -Ra -b samba3.0.28.xls</pre>
<p>for both versions of samba. I&#8217;d create some nice 3d charts but I really don&#8217;t know excel well enough. So, I&#8217;ll just link these here and you can see for yourself what the substantial differences are. Some quick glances while the tests ran, I saw around 50MB/sec for Samba 3.0.28 here and there, topping out at ~60MB/sec. This was only with 256MB and above files. Smaller files always stayed around 5-10MB/sec.</p>
<p>Samba 3.3.3 &#8211; with AIO enabled started up fine, but iozone crashed after wrting a few small 64K bytes. This was a little disappointing, however, I did continue the benchmark with the new send and recieve sizes.</p>
<p><strong>UPDATE:</strong><br />
After doing a little more reading, I found out I was supposed to load the aio kernel module. After running:</p>
<pre>
$ kldload aio
</pre>
<p>I restarted Samba with the AIO options enabled, re-ran iozone, and it all worked.</p>
<p><a href="http://www.mywushublog.com/wp-content/uploads/2009/04/ufs2-3ware-raid5-freebsd71.xls">ufs2-3ware-raid5-freebsd71</a></p>
<p><a href="http://www.mywushublog.com/wp-content/uploads/2009/04/samba3028.xls">samba3028</a></p>
<p><a href="http://www.mywushublog.com/wp-content/uploads/2009/04/samba333.xls">samba333</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.mywushublog.com/2009/04/samba-3028a-vs-333-on-freebsd-71/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
