~ubuntu-branches/ubuntu/lucid/samba/lucid-proposed

« back to all changes in this revision

Viewing changes to docs/htmldocs/Samba-HOWTO-Collection/speed.html

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2005-07-21 17:53:23 UTC
  • mfrom: (0.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20050721175323-m3oh6aoigywohfnq
Tags: 3.0.14a-6ubuntu1
Resynchronise with Debian, resolving merge conflicts (#12360)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Chapter�39.�Samba Performance Tuning</title><link rel="stylesheet" href="samba.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.64.1"><link rel="home" href="index.html" title="The Official Samba-3 HOWTO and Reference Guide"><link rel="up" href="Appendix.html" title="Part�VI.�Appendixes"><link rel="previous" href="Other-Clients.html" title="Chapter�38.�Samba and Other CIFS Clients"><link rel="next" href="DNSDHCP.html" title="Chapter�40.�DNS and DHCP Configuration Guide"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter�39.�Samba Performance Tuning</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="Other-Clients.html">Prev</a>�</td><th width="60%" align="center">Part�VI.�Appendixes</th><td width="20%" align="right">�<a accesskey="n" href="DNSDHCP.html">Next</a></td></tr></table><hr></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="speed"></a>Chapter�39.�Samba Performance Tuning</h2></div><div><div class="author"><h3 class="author"><span class="firstname">Paul</span> <span class="surname">Cochrane</span></h3><div class="affiliation"><span class="orgname">Dundee Limb Fitting Centre<br></span><div class="address"><p><tt class="email">&lt;<a href="mailto:paulc@dth.scot.nhs.uk">paulc@dth.scot.nhs.uk</a>&gt;</tt></p></div></div></div></div><div><div class="author"><h3 class="author"><span class="firstname">Jelmer</span> <span class="othername">R.</span> <span class="surname">Vernooij</span></h3><div class="affiliation"><span class="orgname">The Samba Team<br></span><div class="address"><p><tt class="email">&lt;<a href="mailto:jelmer@samba.org">jelmer@samba.org</a>&gt;</tt></p></div></div></div></div><div><div class="author"><h3 class="author"><span class="firstname">John</span> <span class="othername">H.</span> <span class="surname">Terpstra</span></h3><div class="affiliation"><span class="orgname">Samba Team<br></span><div class="address"><p><tt class="email">&lt;<a href="mailto:jht@samba.org">jht@samba.org</a>&gt;</tt></p></div></div></div></div></div><div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="speed.html#id2600055">Comparisons</a></span></dt><dt><span class="sect1"><a href="speed.html#id2600093">Socket Options</a></span></dt><dt><span class="sect1"><a href="speed.html#id2600182">Read Size</a></span></dt><dt><span class="sect1"><a href="speed.html#id2600220">Max Xmit</a></span></dt><dt><span class="sect1"><a href="speed.html#id2600263">Log Level</a></span></dt><dt><span class="sect1"><a href="speed.html#id2600284">Read Raw</a></span></dt><dt><span class="sect1"><a href="speed.html#id2600337">Write Raw</a></span></dt><dt><span class="sect1"><a href="speed.html#id2600377">Slow Logins</a></span></dt><dt><span class="sect1"><a href="speed.html#id2600396">Client Tuning</a></span></dt><dt><span class="sect1"><a href="speed.html#id2600417">Samba Performance Problem Due to Changing Linux Kernel</a></span></dt><dt><span class="sect1"><a href="speed.html#id2600470">Corrupt tdb Files</a></span></dt><dt><span class="sect1"><a href="speed.html#id2600531">Samba Performance is Very Slow</a></span></dt></dl></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2600055"></a>Comparisons</h2></div></div><div></div></div><p>
 
1
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Chapter�41.�Samba Performance Tuning</title><link rel="stylesheet" href="samba.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.66.1"><link rel="start" href="index.html" title="The Official Samba-3 HOWTO and Reference Guide"><link rel="up" href="Appendix.html" title="Part�VI.�Appendixes"><link rel="prev" href="Other-Clients.html" title="Chapter�40.�Samba and Other CIFS Clients"><link rel="next" href="DNSDHCP.html" title="Chapter�42.�DNS and DHCP Configuration Guide"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter�41.�Samba Performance Tuning</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="Other-Clients.html">Prev</a>�</td><th width="60%" align="center">Part�VI.�Appendixes</th><td width="20%" align="right">�<a accesskey="n" href="DNSDHCP.html">Next</a></td></tr></table><hr></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="speed"></a>Chapter�41.�Samba Performance Tuning</h2></div><div><div class="author"><h3 class="author"><span class="firstname">Paul</span> <span class="surname">Cochrane</span></h3><div class="affiliation"><span class="orgname">Dundee Limb Fitting Centre<br></span><div class="address"><p><tt class="email">&lt;<a href="mailto:paulc@dth.scot.nhs.uk">paulc@dth.scot.nhs.uk</a>&gt;</tt></p></div></div></div></div><div><div class="author"><h3 class="author"><span class="firstname">Jelmer</span> <span class="othername">R.</span> <span class="surname">Vernooij</span></h3><div class="affiliation"><span class="orgname">The Samba Team<br></span><div class="address"><p><tt class="email">&lt;<a href="mailto:jelmer@samba.org">jelmer@samba.org</a>&gt;</tt></p></div></div></div></div><div><div class="author"><h3 class="author"><span class="firstname">John</span> <span class="othername">H.</span> <span class="surname">Terpstra</span></h3><div class="affiliation"><span class="orgname">Samba Team<br></span><div class="address"><p><tt class="email">&lt;<a href="mailto:jht@samba.org">jht@samba.org</a>&gt;</tt></p></div></div></div></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="speed.html#id2621368">Comparisons</a></span></dt><dt><span class="sect1"><a href="speed.html#id2621406">Socket Options</a></span></dt><dt><span class="sect1"><a href="speed.html#id2621495">Read Size</a></span></dt><dt><span class="sect1"><a href="speed.html#id2621533">Max Xmit</a></span></dt><dt><span class="sect1"><a href="speed.html#id2621576">Log Level</a></span></dt><dt><span class="sect1"><a href="speed.html#id2621597">Read Raw</a></span></dt><dt><span class="sect1"><a href="speed.html#id2621650">Write Raw</a></span></dt><dt><span class="sect1"><a href="speed.html#id2621690">Slow Logins</a></span></dt><dt><span class="sect1"><a href="speed.html#id2621709">Client Tuning</a></span></dt><dt><span class="sect1"><a href="speed.html#id2621730">Samba Performance Problem Due to Changing Linux Kernel</a></span></dt><dt><span class="sect1"><a href="speed.html#id2621783">Corrupt tdb Files</a></span></dt><dt><span class="sect1"><a href="speed.html#id2621844">Samba Performance is Very Slow</a></span></dt></dl></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2621368"></a>Comparisons</h2></div></div></div><p>
2
2
The Samba server uses TCP to talk to the client. Thus if you are
3
3
trying to see if it performs well, you should really compare it to
4
4
programs that use the same protocol. The most readily available
20
20
hardware and drivers used on the various systems. Given similar
21
21
hardware, Samba should certainly be competitive in speed with other
22
22
systems.
23
 
</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2600093"></a>Socket Options</h2></div></div><div></div></div><p>
 
23
</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2621406"></a>Socket Options</h2></div></div></div><p>
24
24
There are a number of socket options that can greatly affect the
25
25
performance of a TCP-based server like Samba.
26
26
</p><p>
27
27
The socket options that Samba uses are settable both on the command
28
28
line with the <tt class="option">-O</tt> option, or in the <tt class="filename">smb.conf</tt> file.
29
29
</p><p>
30
 
The <a class="indexterm" name="id2600121"></a>socket options section of the <tt class="filename">smb.conf</tt> manual page describes how
 
30
The <a class="indexterm" name="id2621434"></a>socket options section of the <tt class="filename">smb.conf</tt> manual page describes how
31
31
to set these and gives recommendations.
32
32
</p><p>
33
33
Getting the socket options correct can make a big difference to your
36
36
</p><p>
37
37
The socket option TCP_NODELAY is the one that seems to make the biggest single difference
38
38
for most networks. Many people report that adding
39
 
<a class="indexterm" name="id2600148"></a>socket options = TCP_NODELAY
 
39
<a class="indexterm" name="id2621461"></a>socket options = TCP_NODELAY
40
40
doubles the read performance of a Samba drive. The best explanation I have seen for
41
41
this is that the Microsoft TCP/IP stack is slow in sending TCP ACKs.
42
42
</p><p>
44
44
can seriously degrade Samba performance on the loopback adaptor (IP Address 127.0.0.1). It is strongly
45
45
recommended that before specifying any settings for <i class="parameter"><tt>socket options</tt></i> the effect
46
46
first be quantitatively measured on the server being configured.
47
 
</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2600182"></a>Read Size</h2></div></div><div></div></div><p>
48
 
The option <a class="indexterm" name="id2600190"></a>read size affects the overlap of disk
 
47
</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2621495"></a>Read Size</h2></div></div></div><p>
 
48
The option <a class="indexterm" name="id2621503"></a>read size affects the overlap of disk
49
49
reads/writes with network reads/writes. If the amount of data being
50
50
transferred in several of the SMB commands (currently SMBwrite, SMBwriteX and
51
51
SMBreadbraw) is larger than this value, then the server begins writing
61
61
done as yet to determine the optimal value, and it is likely that the best
62
62
value will vary greatly between systems anyway. A value over 65536 is
63
63
pointless and will cause you to allocate memory unnecessarily.
64
 
</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2600220"></a>Max Xmit</h2></div></div><div></div></div><p>
 
64
</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2621533"></a>Max Xmit</h2></div></div></div><p>
65
65
        At startup the client and server negotiate a <i class="parameter"><tt>maximum transmit</tt></i> size,
66
66
which limits the size of nearly all SMB commands. You can set the
67
 
maximum size that Samba will negotiate using the <a class="indexterm" name="id2600237"></a>max xmit option
 
67
maximum size that Samba will negotiate using the <a class="indexterm" name="id2621550"></a>max xmit option
68
68
in <tt class="filename">smb.conf</tt>. Note that this is the maximum size of SMB requests that 
69
69
Samba will accept, but not the maximum size that the client will accept.
70
70
The client maximum receive size is sent to Samba by the client and Samba
74
74
clients may perform better with a smaller transmit unit. Trying values
75
75
of less than 2048 is likely to cause severe problems.
76
76
In most cases the default is the best option.
77
 
</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2600263"></a>Log Level</h2></div></div><div></div></div><p>
78
 
If you set the log level (also known as <a class="indexterm" name="id2600272"></a>debug level) higher than 2
 
77
</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2621576"></a>Log Level</h2></div></div></div><p>
 
78
If you set the log level (also known as <a class="indexterm" name="id2621585"></a>debug level) higher than 2
79
79
then you may suffer a large drop in performance. This is because the
80
80
server flushes the log file after each operation, which can be quite
81
81
expensive. 
82
 
</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2600284"></a>Read Raw</h2></div></div><div></div></div><p>
83
 
The <a class="indexterm" name="id2600292"></a>read raw operation is designed to be an optimized, low-latency
 
82
</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2621597"></a>Read Raw</h2></div></div></div><p>
 
83
The <a class="indexterm" name="id2621605"></a>read raw operation is designed to be an optimized, low-latency
84
84
file read operation. A server may choose to not support it,
85
 
however, and Samba makes support for <a class="indexterm" name="id2600301"></a>read raw optional, with it
 
85
however, and Samba makes support for <a class="indexterm" name="id2621614"></a>read raw optional, with it
86
86
being enabled by default.
87
87
</p><p>
88
 
In some cases clients do not handle <a class="indexterm" name="id2600313"></a>read raw very well and actually
 
88
In some cases clients do not handle <a class="indexterm" name="id2621626"></a>read raw very well and actually
89
89
get lower performance using it than they get using the conventional
90
90
read operations. 
91
91
</p><p>
92
 
So you might like to try <a class="indexterm" name="id2600326"></a>read raw = no and see what happens on your
 
92
So you might like to try <a class="indexterm" name="id2621639"></a>read raw = no and see what happens on your
93
93
network. It might lower, raise or not effect your performance. Only
94
94
testing can really tell.
95
 
</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2600337"></a>Write Raw</h2></div></div><div></div></div><p>
96
 
The <a class="indexterm" name="id2600345"></a>write raw operation is designed to be an optimized, low-latency
 
95
</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2621650"></a>Write Raw</h2></div></div></div><p>
 
96
The <a class="indexterm" name="id2621658"></a>write raw operation is designed to be an optimized, low-latency
97
97
file write operation. A server may choose to not support it, however, and Samba makes support for
98
 
<a class="indexterm" name="id2600355"></a>write raw optional, with it being enabled by default.
 
98
<a class="indexterm" name="id2621668"></a>write raw optional, with it being enabled by default.
99
99
</p><p>
100
 
Some machines may find <a class="indexterm" name="id2600366"></a>write raw slower than normal write, in which
 
100
Some machines may find <a class="indexterm" name="id2621679"></a>write raw slower than normal write, in which
101
101
case you may wish to change this option.
102
 
</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2600377"></a>Slow Logins</h2></div></div><div></div></div><p>
 
102
</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2621690"></a>Slow Logins</h2></div></div></div><p>
103
103
Slow logins are almost always due to the password checking time. Using
104
 
the lowest practical <a class="indexterm" name="id2600386"></a>password level will improve things. 
105
 
</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2600396"></a>Client Tuning</h2></div></div><div></div></div><p>
 
104
the lowest practical <a class="indexterm" name="id2621699"></a>password level will improve things. 
 
105
</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2621709"></a>Client Tuning</h2></div></div></div><p>
106
106
Often a speed problem can be traced to the client. The client (for
107
107
example Windows for Workgroups) can often be tuned for better TCP
108
108
performance. Check the sections on the various clients in 
109
 
<a href="Other-Clients.html" title="Chapter�38.�Samba and Other CIFS Clients">Samba and Other CIFS Clients</a>.
110
 
</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2600417"></a>Samba Performance Problem Due to Changing Linux Kernel</h2></div></div><div></div></div><p>
 
109
<a href="Other-Clients.html" title="Chapter�40.�Samba and Other CIFS Clients">Samba and Other CIFS Clients</a>.
 
110
</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2621730"></a>Samba Performance Problem Due to Changing Linux Kernel</h2></div></div></div><p>
111
111
A user wrote the following to the mailing list:
112
112
</p><p>
113
113
I am running Gentoo on my server and Samba 2.2.8a. Recently
126
126
My guess is that it is a link layer issue, not an application
127
127
layer problem. Also run ifconfig and verify that the framing
128
128
error, collisions, and so on, look normal for ethernet.
129
 
</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2600470"></a>Corrupt tdb Files</h2></div></div><div></div></div><p>
 
129
</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2621783"></a>Corrupt tdb Files</h2></div></div></div><p>
130
130
Our Samba PDC server has been hosting three TB of data to our 500+ users
131
131
[Windows NT/XP]  for the last three years using Samba without a problem.
132
132
Today all shares went very slow. Also the main smbd kept
143
143
a lot lower than before the locks cleanup. Any ideas on keeping it top notch?
144
144
</p><p>
145
145
<span class="emphasis"><em>Answer:</em></span> Yes. Same answer as for previous question!
146
 
</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2600531"></a>Samba Performance is Very Slow</h2></div></div><div></div></div><p>
 
146
</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2621844"></a>Samba Performance is Very Slow</h2></div></div></div><p>
147
147
A site reported experiencing very baffling symptoms with MYOB Premier opening and
148
148
accessing it's data-files. Some  operations on the file would take between 40 and
149
149
45 seconds.
163
163
process (had to do this many times).
164
164
</p><p>
165
165
Moral of the story, check everything (other software included)!
166
 
</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="Other-Clients.html">Prev</a>�</td><td width="20%" align="center"><a accesskey="u" href="Appendix.html">Up</a></td><td width="40%" align="right">�<a accesskey="n" href="DNSDHCP.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter�38.�Samba and Other CIFS Clients�</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">�Chapter�40.�DNS and DHCP Configuration Guide</td></tr></table></div></body></html>
 
166
</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="Other-Clients.html">Prev</a>�</td><td width="20%" align="center"><a accesskey="u" href="Appendix.html">Up</a></td><td width="40%" align="right">�<a accesskey="n" href="DNSDHCP.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter�40.�Samba and Other CIFS Clients�</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">�Chapter�42.�DNS and DHCP Configuration Guide</td></tr></table></div></body></html>