20
20
hardware and drivers used on the various systems. Given similar
21
21
hardware, Samba should certainly be competitive in speed with other
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.
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.
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.
33
33
Getting the socket options correct can make a big difference to your
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
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.
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
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.
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:
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