1<HTML> 2<HEAD> 3<TITLE> 4[Appendix B] Samba Performance Tuning</title><META NAME="DC.title" CONTENT=""><META NAME="DC.creator" CONTENT=""><META NAME="DC.publisher" CONTENT="O'Reilly & Associates, Inc."><META NAME="DC.date" CONTENT="1999-11-05T21:42:02Z"><META NAME="DC.type" CONTENT="Text.Monograph"><META NAME="DC.format" CONTENT="text/html" SCHEME="MIME"><META NAME="DC.source" CONTENT="" SCHEME="ISBN"><META NAME="DC.language" CONTENT="en-US"><META NAME="generator" CONTENT="Jade 1.1/O'Reilly DocBook 3.0 to HTML 4.0"></head> 5<BODY BGCOLOR="#FFFFFF" TEXT="#000000" link="#990000" vlink="#0000CC"> 6<table BORDER="0" CELLPADDING="0" CELLSPACING="0" width="90%"> 7<tr> 8<td width="25%" valign="TOP"> 9<img hspace=10 vspace=10 src="gifs/samba.s.gif" 10alt="Using Samba" align=left valign=top border=0> 11</td> 12<td height="105" valign="TOP"> 13<br> 14<H2>Using Samba</H2> 15<font size="-1"> 16Robert Eckstein, David Collier-Brown, Peter Kelly 17<br>1st Edition November 1999 18<br>1-56592-449-5, Order Number: 4495 19<br>416 pages, $34.95 20</font> 21<p> <a href="http://www.oreilly.com/catalog/samba/">Buy the hardcopy</a> 22<p><a href="index.html">Table of Contents</a> 23</td> 24</tr> 25</table> 26<hr size=1 noshade> 27<!--sample chapter begins --> 28 29<center> 30<DIV CLASS="htmlnav"> 31<TABLE WIDTH="515" BORDER="0" CELLSPACING="0" CELLPADDING="0"> 32<TR> 33<TD ALIGN="LEFT" VALIGN="TOP" WIDTH="172"> 34<A CLASS="sect1" HREF="appa_05.html" TITLE="A.5 SSL Configuration Options"> 35<IMG SRC="gifs/txtpreva.gif" ALT="Previous: A.5 SSL Configuration Options" BORDER="0"></a></td><TD ALIGN="CENTER" VALIGN="TOP" WIDTH="171"> 36<B> 37<FONT FACE="ARIEL,HELVETICA,HELV,SANSERIF" SIZE="-1"> 38Appendix B</font></b></td><TD ALIGN="RIGHT" VALIGN="TOP" WIDTH="172"> 39<A CLASS="sect1" HREF="appb_02.html" TITLE="B.2 Samba Tuning"> 40<IMG SRC="gifs/txtnexta.gif" ALT="Next: B.2 Samba Tuning" BORDER="0"></a></td></tr></table> <hr noshade size=1></center> 41</div> 42<blockquote> 43<div class="samplechapter"> 44<H1 CLASS="appendix"> 45<A CLASS="title" NAME="appb-66714"> 46B. Samba Performance Tuning</a></h1><DIV CLASS="htmltoc"> 47<P> 48<B> 49Contents:</b><br> 50<A CLASS="sect1" HREF="#appb-47134" TITLE="B.1 A Simple Benchmark"> 51A Simple Benchmark</a><br> 52<A CLASS="sect1" HREF="appb_02.html" TITLE="B.2 Samba Tuning"> 53Samba Tuning</a><br> 54<A CLASS="sect1" HREF="appb_03.html" TITLE="B.3 Sizing Samba Servers"> 55Sizing Samba Servers</a></p><P> 56</p></div><P CLASS="para">This appendix discusses various ways of performance tuning and system sizing with Samba. <I CLASS="firstterm"> 57Performance tuning</i> is the art of finding bottlenecks and adjusting to eliminate them. <EM CLASS="emphasis"> 58Sizing</em> is the practice of eliminating bottlenecks by spending money to avoid having them in the first place. Normally, you won't have to worry about either with Samba. On a completely untuned server, Samba will happily support a small community of users. However, on a properly tuned server, Samba will support at least twice as many users. This chapter is devoted to outlining various performance-tuning and sizing techniques that you can use if you want to stretch your Samba server to the limit.</p><DIV CLASS="sect1"> 59<H2 CLASS="sect1"> 60<A CLASS="title" NAME="appb-47134"> 61B.1 A Simple Benchmark</a></h2><P CLASS="para">How do you know if you're getting reasonable performance? A simple benchmark is to compare Samba with FTP. <A CLASS="xref" HREF="appb_01.html#appb-73167"> 62Table B.1</a> shows the throughput, in kilobytes per second, of a pair of servers: a medium-size Sun SPARC Ultra and a small Linux Pentium server. Numbers are reported in kilobytes per second (KB/s). </p><br> 63<TABLE CLASS="table" BORDER="1" CELLPADDING="3"> 64<CAPTION CLASS="table"> 65<A CLASS="title" NAME="appb-73167"> 66Table B.1: Sample Benchmark Benchmarks </a></caption><THEAD CLASS="thead"> 67<TR CLASS="row" VALIGN="TOP"> 68<TH CLASS="entry" ALIGN="LEFT" ROWSPAN="1" COLSPAN="1"> 69<P CLASS="para"> 70Command</p></th><TH CLASS="entry" ALIGN="LEFT" ROWSPAN="1" COLSPAN="1"> 71<P CLASS="para"> 72FTP</p></th><TH CLASS="entry" ALIGN="LEFT" ROWSPAN="1" COLSPAN="1"> 73<P CLASS="para"> 74Untuned Samba</p></th><TH CLASS="entry" ALIGN="LEFT" ROWSPAN="1" COLSPAN="1"> 75<P CLASS="para"> 76Tuned Samba</p></th></tr></thead><TBODY CLASS="tbody"> 77<TR CLASS="row" VALIGN="TOP"> 78<TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 79<P CLASS="para"> 80Sparc get</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 81<P CLASS="para"> 821014.5</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 83<P CLASS="para"> 84645.3</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 85<P CLASS="para"> 86866.7</p></td></tr><TR CLASS="row" VALIGN="TOP"> 87<TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 88<P CLASS="para"> 89Sparc put</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 90<P CLASS="para"> 91379.8 </p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 92<P CLASS="para"> 93386.1</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 94<P CLASS="para"> 95329.5</p></td></tr><TR CLASS="row" VALIGN="TOP"> 96<TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 97<P CLASS="para"> 98Pentium get</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 99<P CLASS="para"> 100973.27</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 101<P CLASS="para"> 102N/A</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 103<P CLASS="para"> 104725</p></td></tr><TR CLASS="row" VALIGN="TOP"> 105<TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 106<P CLASS="para"> 107Pentium put</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 108<P CLASS="para"> 1091014.5</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 110<P CLASS="para"> 111N/A</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 112<P CLASS="para"> 1131100</p></td></tr></tbody></table><P CLASS="para"> 114If you run the same tests on your server, you probably won't see the same numbers. However, you <EM CLASS="emphasis"> 115should </em>see similar ratios of Samba to FTP, probably in the range of 68 to 80 percent. It's not a good idea to base <EM CLASS="emphasis"> 116all</em> of Samba's throughput against FTP. The golden rule to remember is this: if Samba is much slower than FTP, it's time to tune it.</p><P CLASS="para"> 117You might think that an equivalent test would be to compare Samba to NFS. In reality, however, it's much less useful to compare their speeds. Depending entirely on whose version of NFS you have and how well it's tuned, Samba can be slower or faster than NFS. We usually find that Samba is faster, but watch out; NFS uses a different algorithm from Samba, so tuning options that are optimal for NFS may be detrimental for Samba. If you run Samba on a well-tuned NFS server, Samba may perform rather badly.</p><P CLASS="para"> 118A more popular benchmark is Ziff-Davis' <EM CLASS="emphasis"> 119NetBench, </em>a simulation of many users on client machines running word processors and accessing data on the SMB server. It's not a prefect measure (each NetBench client does about ten times the work of a normal user on our site), but it is a fair comparison of similar servers. In tests performed by Jeremy Allison in November 1998, Samba 2.0 on a SGI multiprocessor outperformed NT Server 4.0 (Patch Level 2) on an equivalent high-end Compaq. This was confirmed and strengthened by a Sm@rt Reseller test of NT and Linux on identical hardware in February 1999. </p><P CLASS="para"> 120In April 1999, the Mindcraft test lab released a report about a test showing that Samba on a four-processor Linux machine was significantly slower than native file serving on the same machine running Windows NT. While the original report was slammed by the Open Source community because it was commissioned by Microsoft and tuned the systems to favor Windows NT, a subsequent test was fairer and generally admitted to reveal some areas where Linux needed to improve its performance, especially on multiprocessors. Little was said about Samba itself. Samba is known to scale well on multiprocessors, and exceeds 440MB/s on a four-processor SGI O200, beating Mindcraft's 310MB/s.</p><P CLASS="para"> 121Relative performance will probably change as NT and PC hardware get faster, of course, but Samba is improving as well. For example, Samba 1.9.18 was faster only with more than 35 clients. Samba 2.0, however, is faster regardless of the number of clients. In short, Samba is very competitive with the best networking software in the industry, and is only getting better. </p><P CLASS="para"> 122As we went to press, Andrew Tridgell released the alpha-test version suite of benchmarking programs for Samba and SMB networks. Expect even more work on performance from the Samba team in the future.</p></div></div></blockquote> 123<div> 124<center> 125<hr noshade size=1><TABLE WIDTH="515" BORDER="0" CELLSPACING="0" CELLPADDING="0"> 126<TR> 127<TD ALIGN="LEFT" VALIGN="TOP" WIDTH="172"> 128<A CLASS="sect1" HREF="appa_05.html" TITLE="A.5 SSL Configuration Options"> 129<IMG SRC="gifs/txtpreva.gif" ALT="Previous: A.5 SSL Configuration Options" BORDER="0"></a></td><TD ALIGN="CENTER" VALIGN="TOP" WIDTH="171"> 130<A CLASS="book" HREF="index.html" TITLE=""> 131<IMG SRC="gifs/txthome.gif" ALT="" BORDER="0"></a></td><TD ALIGN="RIGHT" VALIGN="TOP" WIDTH="172"> 132<A CLASS="sect1" HREF="appb_02.html" TITLE="B.2 Samba Tuning"> 133<IMG SRC="gifs/txtnexta.gif" ALT="Next: B.2 Samba Tuning" BORDER="0"></a></td></tr><TR> 134<TD ALIGN="LEFT" VALIGN="TOP" WIDTH="172"> 135A.5 SSL Configuration Options</td><TD ALIGN="CENTER" VALIGN="TOP" WIDTH="171"> 136<A CLASS="index" HREF="inx.html" TITLE="Book Index"> 137<IMG SRC="gifs/index.gif" ALT="Book Index" BORDER="0"></a></td><TD ALIGN="RIGHT" VALIGN="TOP" WIDTH="172"> 138B.2 Samba Tuning</td></tr></table><hr noshade size=1></center> 139</div> 140 141<!-- End of sample chapter --> 142<CENTER> 143<FONT SIZE="1" FACE="Verdana, Arial, Helvetica"> 144<A HREF="http://www.oreilly.com/"> 145<B>O'Reilly Home</B></A> <B> | </B> 146<A HREF="http://www.oreilly.com/sales/bookstores"> 147<B>O'Reilly Bookstores</B></A> <B> | </B> 148<A HREF="http://www.oreilly.com/order_new/"> 149<B>How to Order</B></A> <B> | </B> 150<A HREF="http://www.oreilly.com/oreilly/contact.html"> 151<B>O'Reilly Contacts<BR></B></A> 152<A HREF="http://www.oreilly.com/international/"> 153<B>International</B></A> <B> | </B> 154<A HREF="http://www.oreilly.com/oreilly/about.html"> 155<B>About O'Reilly</B></A> <B> | </B> 156<A HREF="http://www.oreilly.com/affiliates.html"> 157<B>Affiliated Companies</B></A><p> 158<EM>© 1999, O'Reilly & Associates, Inc.</EM> 159</FONT> 160</CENTER> 161</BODY> 162</html> 163