~zulcss/samba/server-dailies-3.4

« back to all changes in this revision

Viewing changes to docs/htmldocs/Samba3-ByExample/HA.html

  • Committer: Chuck Short
  • Date: 2010-09-28 20:38:39 UTC
  • Revision ID: zulcss@ubuntu.com-20100928203839-pgjulytsi9ue63x1
Initial version

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�13.�Performance, Reliability, and Availability</title><link rel="stylesheet" href="../samba.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.74.0"><link rel="home" href="index.html" title="Samba-3 by Example"><link rel="up" href="RefSection.html" title="Part�III.�Reference Section"><link rel="prev" href="DomApps.html" title="Chapter�12.�Integrating Additional Services"><link rel="next" href="ch14.html" title="Chapter�14.�Samba Support"></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�13.�Performance, Reliability, and Availability</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="DomApps.html">Prev</a>�</td><th width="60%" align="center">Part�III.�Reference Section</th><td width="20%" align="right">�<a accesskey="n" href="ch14.html">Next</a></td></tr></table><hr></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="HA"></a>Chapter�13.�Performance, Reliability, and Availability</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="HA.html#id2618932">Introduction</a></span></dt><dt><span class="sect1"><a href="HA.html#id2619030">Dissection and Discussion</a></span></dt><dt><span class="sect1"><a href="HA.html#id2619503">Guidelines for Reliable Samba Operation</a></span></dt><dd><dl><dt><span class="sect2"><a href="HA.html#id2619530">Name Resolution</a></span></dt><dt><span class="sect2"><a href="HA.html#id2620006">Samba Configuration</a></span></dt><dt><span class="sect2"><a href="HA.html#id2620334">Use and Location of BDCs</a></span></dt><dt><span class="sect2"><a href="HA.html#id2620409">Use One Consistent Version of MS Windows Client</a></span></dt><dt><span class="sect2"><a href="HA.html#id2620431">For Scalability, Use SAN-Based Storage on Samba Servers</a></span></dt><dt><span class="sect2"><a href="HA.html#id2620480">Distribute Network Load with MSDFS</a></span></dt><dt><span class="sect2"><a href="HA.html#id2620535">Replicate Data to Conserve Peak-Demand Wide-Area Bandwidth</a></span></dt><dt><span class="sect2"><a href="HA.html#id2620581">Hardware Problems</a></span></dt><dt><span class="sect2"><a href="HA.html#id2620728">Large Directories</a></span></dt></dl></dd><dt><span class="sect1"><a href="HA.html#id2620832">Key Points Learned</a></span></dt></dl></div><p>
 
2
        <a class="indexterm" name="id2618895"></a>
 
3
        <a class="indexterm" name="id2618901"></a>
 
4
        <a class="indexterm" name="id2618908"></a>
 
5
        Well, you have reached one of the last chapters of this book. It is customary to attempt
 
6
        to wrap up the theme and contents of a book in what is generally regarded as the
 
7
        chapter that should draw conclusions. This book is a suspense thriller, and since
 
8
        the plot of the stories told mostly lead you to bigger, better Samba-3 networking
 
9
        solutions, it is perhaps appropriate to close this book with a few pertinent comments
 
10
        regarding some of the things everyone can do to deliver a reliable Samba-3 network.
 
11
        </p><div class="blockquote"><table border="0" width="100%" cellspacing="0" cellpadding="0" class="blockquote" summary="Block quote"><tr><td width="10%" valign="top">�</td><td width="80%" valign="top"><p>
 
12
        In a world so full of noise, how can the sparrow be heard?
 
13
        </p></td><td width="10%" valign="top">�</td></tr><tr><td width="10%" valign="top">�</td><td colspan="2" align="right" valign="top">--<span class="attribution">Anonymous</span></td></tr></table></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2618932"></a>Introduction</h2></div></div></div><p>
 
14
        <a class="indexterm" name="id2618940"></a>
 
15
        The sparrow is a small bird whose sounds are drowned out by the noise of the busy
 
16
        world it lives in. Likewise, the simple steps that can be taken to improve the
 
17
        reliability and availability of a Samba network are often drowned out by the volume
 
18
        of discussions about grandiose Samba clustering designs. This is not intended to
 
19
        suggest that clustering is not important, because clearly it is. This chapter does not devote
 
20
        itself to discussion of clustering because each clustering methodology uses its own
 
21
        custom tools and methods. Only passing comments are offered concerning these methods.
 
22
        </p><p>
 
23
        <a class="indexterm" name="id2618970"></a>
 
24
        <a class="indexterm" name="id2618977"></a>
 
25
        <a class="indexterm" name="id2618984"></a>
 
26
<a class="ulink" href="http://www.google.com/search?hl=en&amp;lr=&amp;ie=ISO-8859-1&amp;q=samba+cluster&amp;btnG=Google+Search" target="_top">A search</a> 
 
27
        for &#8220;<span class="quote">samba cluster</span>&#8221; produced 71,600 hits. And a search for &#8220;<span class="quote">highly available samba</span>&#8221;
 
28
        and &#8220;<span class="quote">highly available windows</span>&#8221; produced an amazing number of references.
 
29
        It is clear from the resources on the Internet that Windows file and print services 
 
30
        availability, reliability, and scalability are of vital interest to corporate network users.
 
31
        </p><p>
 
32
        <a class="indexterm" name="id2619018"></a>
 
33
        So without further background, you can review a checklist of simple steps that
 
34
        can be taken to ensure acceptable network performance while keeping costs of ownership
 
35
        well under control.
 
36
        </p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2619030"></a>Dissection and Discussion</h2></div></div></div><p>
 
37
        <a class="indexterm" name="id2619038"></a>
 
38
        <a class="indexterm" name="id2619045"></a>
 
39
        If it is your purpose to get the best mileage out of your Samba servers, there is one rule that
 
40
        must be obeyed. If you want the best, keep your implementation as simple as possible. You may
 
41
        well be forced to introduce some complexities, but you should do so only as a last resort.
 
42
        </p><p>
 
43
        Simple solutions are likely to be easier to get right than are complex ones. They certainly
 
44
        make life easier for your successor. Simple implementations can be more readily audited than can
 
45
        complex ones. 
 
46
        </p><p>
 
47
        <a class="indexterm" name="id2619067"></a>
 
48
        <a class="indexterm" name="id2619074"></a>
 
49
        Problems reported by users fall into three categories: configurations that do not work, those 
 
50
        that have broken behavior, and poor performance. The term <span class="emphasis"><em>broken behavior</em></span>
 
51
        means that the function of a particular Samba component appears to work sometimes, but not at
 
52
        others. The resulting intermittent operation is clearly unacceptable. An example of 
 
53
        <span class="emphasis"><em>broken behavior</em></span> known to many Windows networking users occurs when the
 
54
        list of Windows machines in MS Explorer changes, sometimes listing machines that are running
 
55
        and at other times not listing them even though the machines are in use on the network.
 
56
        </p><p>
 
57
        <a class="indexterm" name="id2619101"></a>
 
58
        <a class="indexterm" name="id2619108"></a>
 
59
        <a class="indexterm" name="id2619115"></a>
 
60
        <a class="indexterm" name="id2619121"></a>
 
61
        <a class="indexterm" name="id2619128"></a>
 
62
        <a class="indexterm" name="id2619135"></a>
 
63
        A significant number of reports concern problems with the <code class="literal">smbfs</code> file system
 
64
        driver that is part of the Linux kernel, not part of Samba. Users continue to interpret that
 
65
        <code class="literal">smbfs</code> is part of Samba, simply because Samba includes the front-end tools
 
66
        that are used to manage <code class="literal">smbfs</code>-based file service connections. So, just
 
67
        for the record, the tools <code class="literal">smbmnt</code>, <code class="literal">smbmount</code>,
 
68
        <code class="literal">smbumount</code>, and <code class="literal">smbumnt</code> are front-end
 
69
        facilities to core drivers that are supplied as part of the Linux kernel. These tools share a
 
70
        common infrastructure with some Samba components, but they are not maintained as part of
 
71
        Samba and are really foreign to it.
 
72
        </p><p>
 
73
        <a class="indexterm" name="id2619196"></a>
 
74
        The new project, <code class="literal">cifsfs</code>, is destined to replace <code class="literal">smbfs</code>.
 
75
        It, too, is not part of Samba, even though one of the Samba Team members is a prime mover in
 
76
        this project.
 
77
        </p><p>
 
78
        Table 13.1 lists typical causes of:
 
79
        </p><div class="itemizedlist"><ul type="disc"><li><p>Not Working (NW)</p></li><li><p>Broken Behavior (BB)</p></li><li><p>Poor Performance (PP)</p></li></ul></div><div class="table"><a name="ProbList"></a><p class="title"><b>Table�13.1.�Effect of Common Problems</b></p><div class="table-contents"><table summary="Effect of Common Problems" border="1"><colgroup><col align="left"><col align="center"><col align="center"><col align="center"></colgroup><thead><tr><th align="left"><p>Problem</p></th><th align="center"><p>NW</p></th><th align="center"><p>BB</p></th><th align="center"><p>PP</p></th></tr></thead><tbody><tr><td align="left"><p>File locking</p></td><td align="center"><p>-</p></td><td align="center"><p>X</p></td><td align="center"><p>-</p></td></tr><tr><td align="left"><p>Hardware problems</p></td><td align="center"><p>X</p></td><td align="center"><p>X</p></td><td align="center"><p>X</p></td></tr><tr><td align="left"><p>Incorrect authentication</p></td><td align="center"><p>X</p></td><td align="center"><p>X</p></td><td align="center"><p>-</p></td></tr><tr><td align="left"><p>Incorrect configuration</p></td><td align="center"><p>X</p></td><td align="center"><p>X</p></td><td align="center"><p>X</p></td></tr><tr><td align="left"><p>LDAP problems</p></td><td align="center"><p>X</p></td><td align="center"><p>X</p></td><td align="center"><p>-</p></td></tr><tr><td align="left"><p>Name resolution</p></td><td align="center"><p>X</p></td><td align="center"><p>X</p></td><td align="center"><p>X</p></td></tr><tr><td align="left"><p>Printing problems</p></td><td align="center"><p>X</p></td><td align="center"><p>X</p></td><td align="center"><p>-</p></td></tr><tr><td align="left"><p>Slow file transfer</p></td><td align="center"><p>-</p></td><td align="center"><p>-</p></td><td align="center"><p>X</p></td></tr><tr><td align="left"><p>Winbind problems</p></td><td align="center"><p>X</p></td><td align="center"><p>X</p></td><td align="center"><p>-</p></td></tr></tbody></table></div></div><br class="table-break"><p>
 
80
        <a class="indexterm" name="id2619490"></a>
 
81
        It is obvious to all that the first requirement (as a matter of network hygiene) is to eliminate
 
82
        problems that affect basic network operation. This book has provided sufficient working examples
 
83
        to help you to avoid all these problems.
 
84
        </p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2619503"></a>Guidelines for Reliable Samba Operation</h2></div></div></div><p>
 
85
        <a class="indexterm" name="id2619511"></a>
 
86
        <a class="indexterm" name="id2619518"></a>
 
87
        Your objective is to provide a network that works correctly, can grow at all times, is resilient
 
88
        at times of extreme demand, and can scale to meet future needs. The following subject areas provide
 
89
        pointers that can help you today.
 
90
        </p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2619530"></a>Name Resolution</h3></div></div></div><p>
 
91
        There are three basic current problem areas: bad hostnames, routed networks, and network collisions.
 
92
        These are covered in the following discussion.
 
93
        </p><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2619542"></a>Bad Hostnames</h4></div></div></div><p>
 
94
                <a class="indexterm" name="id2619550"></a>
 
95
                <a class="indexterm" name="id2619559"></a>
 
96
                <a class="indexterm" name="id2619566"></a>
 
97
                <a class="indexterm" name="id2619573"></a>
 
98
                <a class="indexterm" name="id2619579"></a>
 
99
                When configured as a DHCP client, a number of Linux distributions set the system hostname
 
100
                to <code class="constant">localhost</code>. If the parameter <em class="parameter"><code>netbios name</code></em> is not
 
101
                specified to something other than <code class="constant">localhost</code>, the Samba server appears
 
102
                in the Windows Explorer as <code class="constant">LOCALHOST</code>. Moreover, the entry in the <code class="filename">/etc/hosts</code>
 
103
                on the Linux server points to IP address <code class="constant">127.0.0.1</code>. This means that
 
104
                when the Windows client obtains the IP address of the Samba server called <code class="constant">LOCALHOST</code>,
 
105
                it obtains the IP address <code class="constant">127.0.0.1</code> and then proceeds to attempt to
 
106
                set up a NetBIOS over TCP/IP connection to it. This cannot work, because that IP address is
 
107
                the local Windows machine itself. Hostnames must be valid for Windows networking to function
 
108
                correctly.
 
109
                </p><p>
 
110
                <a class="indexterm" name="id2619634"></a>
 
111
                A few sites have tried to name Windows clients and Samba servers with a name that begins
 
112
                with the digits 1-9. This does not work either because it may result in the client or
 
113
                server attempting to use that name as an IP address.
 
114
                </p><p>
 
115
                <a class="indexterm" name="id2619648"></a>
 
116
                <a class="indexterm" name="id2619657"></a>
 
117
                A Samba server called <code class="constant">FRED</code> in a NetBIOS domain called <code class="constant">COLLISION</code>
 
118
                in a network environment that is part of the fully-qualified Internet domain namespace known
 
119
                as <code class="constant">parrots.com</code>, results in DNS name lookups for <code class="constant">fred.parrots.com</code>
 
120
                and <code class="constant">collision.parrots.com</code>. It is therefore a mistake to name the domain
 
121
                (workgroup) <code class="constant">collision.parrots.com</code>, since this results in DNS lookup
 
122
                attempts to resolve <code class="constant">fred.parrots.com.parrots.com</code>, which most likely
 
123
                fails given that you probably do not have this in your DNS namespace.
 
124
                </p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
 
125
                <a class="indexterm" name="id2619702"></a>
 
126
                <a class="indexterm" name="id2619711"></a>
 
127
                <a class="indexterm" name="id2619717"></a>
 
128
                An Active Directory realm called <code class="constant">collision.parrots.com</code> is perfectly okay,
 
129
                although it too must be capable of being resolved via DNS, something that functions correctly
 
130
                if Windows 200x ADS has been properly installed and configured.
 
131
                </p></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2619734"></a>Routed Networks</h4></div></div></div><p>
 
132
                <a class="indexterm" name="id2619742"></a>
 
133
                <a class="indexterm" name="id2619748"></a>
 
134
                <a class="indexterm" name="id2619758"></a>
 
135
                NetBIOS networks (Windows networking with NetBIOS over TCP/IP enabled) makes extensive use
 
136
                of UDP-based broadcast traffic, as you saw during the exercises in <a class="link" href="primer.html" title="Chapter�16.�Networking Primer">&#8220;Networking Primer&#8221;</a>.
 
137
                </p><p>
 
138
                <a class="indexterm" name="id2619777"></a>
 
139
                <a class="indexterm" name="id2619784"></a>
 
140
                <a class="indexterm" name="id2619791"></a>
 
141
                UDP broadcast traffic is not forwarded by routers. This means that NetBIOS broadcast-based
 
142
                networking cannot function across routed networks (i.e., multi-subnet networks) unless
 
143
                special provisions are made:
 
144
                </p><div class="itemizedlist"><ul type="disc"><li><p>
 
145
                        <a class="indexterm" name="id2619808"></a>
 
146
                        <a class="indexterm" name="id2619815"></a>
 
147
                        <a class="indexterm" name="id2619822"></a>
 
148
                        Either install on every Windows client an LMHOSTS file (located in the directory
 
149
                        <code class="filename">C:\windows\system32\drivers\etc</code>). It is also necessary to
 
150
                        add to the Samba server <code class="filename">smb.conf</code> file the parameters <em class="parameter"><code>remote announce</code></em>
 
151
                        and <em class="parameter"><code>remote browse sync</code></em>. For more information, refer to the online
 
152
                        manual page for the <code class="filename">smb.conf</code> file.
 
153
                        </p></li><li><p>
 
154
                        <a class="indexterm" name="id2619867"></a>
 
155
                        Or configure Samba as a WINS server, and configure all network clients to use that
 
156
                        WINS server in their TCP/IP configuration.
 
157
                        </p></li></ul></div><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
 
158
                <a class="indexterm" name="id2619884"></a>
 
159
                <a class="indexterm" name="id2619893"></a>
 
160
                The use of DNS is not an acceptable substitute for WINS. DNS does not store specific
 
161
                information regarding NetBIOS networking particulars that get stored in the WINS
 
162
                name resolution database and that Windows clients require and depend on.
 
163
                </p></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2619906"></a>Network Collisions</h4></div></div></div><p>
 
164
                <a class="indexterm" name="id2619914"></a>
 
165
                <a class="indexterm" name="id2619923"></a>
 
166
                <a class="indexterm" name="id2619933"></a>
 
167
                <a class="indexterm" name="id2619940"></a>
 
168
                Excessive network activity causes NetBIOS network timeouts. Timeouts may result in
 
169
                blue screen of death (BSOD) experiences. High collision rates may be caused by excessive
 
170
                UDP broadcast activity, by defective networking hardware, or through excessive network
 
171
                loads (another way of saying that the network is poorly designed).
 
172
                </p><p>
 
173
                The use of WINS is highly recommended to reduce network broadcast traffic, as outlined
 
174
                in <a class="link" href="primer.html" title="Chapter�16.�Networking Primer">&#8220;Networking Primer&#8221;</a>.
 
175
                </p><p>
 
176
                <a class="indexterm" name="id2619968"></a>
 
177
                <a class="indexterm" name="id2619975"></a>
 
178
                <a class="indexterm" name="id2619982"></a>
 
179
                Under no circumstances should the facility be supported by many routers, known as <code class="constant">NetBIOS
 
180
                forwarding</code>, unless you know exactly what you are doing. Inappropriate use of this
 
181
                facility can result in UDP broadcast storms. In one case in 1999, a university network became
 
182
                unusable due to NetBIOS forwarding being enabled on all routers. The problem was discovered during performance
 
183
                testing of a Samba server. The maximum throughput on a 100-Base-T (100 MB/sec) network was
 
184
                less than 15 KB/sec. After the NetBIOS forwarding was turned off, file transfer performance
 
185
                immediately returned to 11 MB/sec.
 
186
                </p></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2620006"></a>Samba Configuration</h3></div></div></div><p>
 
187
        As a general rule, the contents of the <code class="filename">smb.conf</code> file should be kept as simple as possible.
 
188
        No parameter should be specified unless you know it is essential to operation.
 
189
        </p><p>
 
190
        <a class="indexterm" name="id2620026"></a>
 
191
        <a class="indexterm" name="id2620033"></a>
 
192
        <a class="indexterm" name="id2620040"></a>
 
193
        Many UNIX administrators like to fully document the settings in the <code class="filename">smb.conf</code> file. This is a
 
194
        bad idea because it adds content to the file. The <code class="filename">smb.conf</code> file is re-read by every <code class="literal">smbd</code>
 
195
        process every time the file timestamp changes (or, on systems where this does not work, every 20 seconds or so).
 
196
        </p><p>
 
197
        As the size of the <code class="filename">smb.conf</code> file grows, the risk of introducing parsing errors also increases.
 
198
        It is recommended to keep a fully documented <code class="filename">smb.conf</code> file on hand, and then to operate Samba only
 
199
        with an optimized file.
 
200
        </p><p><a class="indexterm" name="id2620090"></a>
 
201
        The preferred way to maintain a documented file is to call it something like <code class="filename">smb.conf.master</code>.
 
202
        You can generate the optimized file by executing:
 
203
</p><pre class="screen">
 
204
<code class="prompt">root# </code> testparm -s smb.conf.master &gt; smb.conf
 
205
</pre><p>
 
206
        You should carefully observe all warnings issued. It is also a good practice to execute the following
 
207
        command to confirm correct interpretation of the <code class="filename">smb.conf</code> file contents:
 
208
</p><pre class="screen">
 
209
<code class="prompt">root# </code> testparm
 
210
Load smb config files from /etc/samba/smb.conf
 
211
Can't find include file /etc/samba/machine.
 
212
Processing section "[homes]"
 
213
Processing section "[print$]"
 
214
Processing section "[netlogon]"
 
215
Processing section "[Profiles]"
 
216
Processing section "[printers]"
 
217
Processing section "[media]"
 
218
Processing section "[data]"
 
219
Processing section "[cdr]"
 
220
Processing section "[apps]"
 
221
Loaded services file OK.
 
222
'winbind separator = +' might cause problems with group membership.
 
223
Server role: ROLE_DOMAIN_PDC
 
224
Press enter to see a dump of your service definitions
 
225
</pre><p>
 
226
        <a class="indexterm" name="id2620149"></a>
 
227
        You now, of course, press the enter key to complete the command, or else abort it by pressing Ctrl-C.
 
228
        The important thing to note is the noted Server role, as well as warning messages. Noted configuration
 
229
        conflicts must be remedied before proceeding. For example, the following error message represents a
 
230
        common fatal problem:
 
231
</p><pre class="screen">
 
232
ERROR: both 'wins support = true' and 'wins server = &lt;server list&gt;' 
 
233
cannot be set in the smb.conf file. nmbd will abort with this setting.
 
234
</pre><p>
 
235
        </p><p>
 
236
        <a class="indexterm" name="id2620177"></a>
 
237
        <a class="indexterm" name="id2620184"></a>
 
238
        <a class="indexterm" name="id2620191"></a>
 
239
        There are two parameters that can cause severe network performance degradation: <em class="parameter"><code>socket options</code></em>
 
240
        and <em class="parameter"><code>socket address</code></em>. The <em class="parameter"><code>socket options</code></em> parameter was often necessary
 
241
        when Samba was used with the Linux 2.2.x kernels. Later kernels are largely self-tuning and seldom benefit from
 
242
        this parameter being set. Do not use either parameter unless it has been proven necessary to use them.
 
243
        </p><p>
 
244
        <a class="indexterm" name="id2620225"></a>
 
245
        <a class="indexterm" name="id2620231"></a>
 
246
        <a class="indexterm" name="id2620238"></a>
 
247
        <a class="indexterm" name="id2620245"></a>
 
248
        Another <code class="filename">smb.conf</code> parameter that may cause severe network performance degradation is the 
 
249
        <em class="parameter"><code>strict sync</code></em> parameter. Do not use this at all. There is no good reason
 
250
        to use this with any modern Windows client. The <em class="parameter"><code>strict sync</code></em> is often
 
251
        used with the <em class="parameter"><code>sync always</code></em> parameter. This, too, can severely    
 
252
        degrade network performance, so do not set it; if you must, do so with caution.
 
253
        </p><p>
 
254
        <a class="indexterm" name="id2620287"></a>
 
255
        <a class="indexterm" name="id2620294"></a>
 
256
        <a class="indexterm" name="id2620301"></a>
 
257
        <a class="indexterm" name="id2620308"></a>
 
258
        Finally, many network administrators deliberately disable opportunistic locking support. While this
 
259
        does not degrade Samba performance, it significantly degrades Windows client performance because
 
260
        this disables local file caching on Windows clients and forces every file read and written to
 
261
        invoke a network read or write call. If for any reason you must disable oplocks (opportunistic locking)
 
262
        support, do so only on the share on which it is required. That way, all other shares can provide
 
263
        oplock support for operations that are tolerant of it. See <a class="link" href="appendix.html#ch12dblck" title="Shared Data Integrity">&#8220;Shared Data Integrity&#8221;</a> for more
 
264
        information.
 
265
        </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2620334"></a>Use and Location of BDCs</h3></div></div></div><p>
 
266
        <a class="indexterm" name="id2620342"></a>
 
267
        <a class="indexterm" name="id2620348"></a>
 
268
        <a class="indexterm" name="id2620354"></a>
 
269
        <a class="indexterm" name="id2620361"></a>
 
270
        <a class="indexterm" name="id2620368"></a>
 
271
        On a network segment where there is a PDC and a BDC, the BDC carries the bulk of the network logon
 
272
        processing. If the BDC is a heavily loaded server, the PDC carries a greater proportion of
 
273
        authentication and logon processing. When a sole BDC on a routed network segment gets heavily
 
274
        loaded, it is possible that network logon requests and authentication requests may be directed
 
275
        to a BDC on a distant network segment. This significantly hinders WAN operations
 
276
        and is undesirable.
 
277
        </p><p>
 
278
        <a class="indexterm" name="id2620387"></a>
 
279
        <a class="indexterm" name="id2620394"></a>
 
280
        As a general guide, instead of adding domain member servers to a network, you would be better advised
 
281
        to add BDCs until there are fewer than 30 Windows clients per BDC. Beyond that ratio, you should add
 
282
        domain member servers. This practice ensures that there are always sufficient domain controllers
 
283
        to handle logon requests and authentication traffic.
 
284
        </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2620409"></a>Use One Consistent Version of MS Windows Client</h3></div></div></div><p>
 
285
        Every network client has its own peculiarities. From a management perspective, it is easier to deal
 
286
        with one version of MS Windows that is maintained to a consistent update level than it is to deal
 
287
        with a mixture of clients.
 
288
        </p><p>
 
289
        On a number of occasions, particular Microsoft service pack updates of a Windows server or client
 
290
        have necessitated special handling from the Samba server end. If you want to remain sane, keep you
 
291
        client workstation configurations consistent.
 
292
        </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2620431"></a>For Scalability, Use SAN-Based Storage on Samba Servers</h3></div></div></div><p>
 
293
        <a class="indexterm" name="id2620439"></a>
 
294
        <a class="indexterm" name="id2620446"></a>
 
295
        Many SAN-based storage systems permit more than one server to share a common data store.
 
296
        Use of a shared SAN data store means that you do not need to use time- and resource-hungry data 
 
297
        synchronization techniques.
 
298
        </p><p>
 
299
        <a class="indexterm" name="id2620460"></a>
 
300
        <a class="indexterm" name="id2620467"></a>
 
301
        The use of a collection of relatively low-cost front-end Samba servers that are coupled to
 
302
        a shared backend SAN data store permits load distribution while containing costs below that
 
303
        of installing and managing a complex clustering facility.
 
304
        </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2620480"></a>Distribute Network Load with MSDFS</h3></div></div></div><p>
 
305
        <a class="indexterm" name="id2620488"></a>
 
306
        <a class="indexterm" name="id2620495"></a>
 
307
        Microsoft DFS (distributed file system) technology has been implemented in Samba. MSDFS permits
 
308
        data to be accessed from a single share and yet to actually be distributed across multiple actual
 
309
        servers. Refer to <span class="emphasis"><em>TOSHARG2</em></span>, Chapter 19, for information regarding
 
310
        implementation of an MSDFS installation.
 
311
        </p><p>
 
312
        <a class="indexterm" name="id2620514"></a>
 
313
        <a class="indexterm" name="id2620523"></a>
 
314
        The combination of multiple backend servers together with a front-end server and use of MSDFS
 
315
        can achieve almost the same as you would obtain with a clustered Samba server.
 
316
        </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2620535"></a>Replicate Data to Conserve Peak-Demand Wide-Area Bandwidth</h3></div></div></div><p>
 
317
        <a class="indexterm" name="id2620544"></a>
 
318
        <a class="indexterm" name="id2620550"></a>
 
319
        <a class="indexterm" name="id2620557"></a>
 
320
        Consider using <code class="literal">rsync</code> to replicate data across the WAN during times
 
321
        of low utilization. Users can then access the replicated data store rather than needing to do so
 
322
        across the WAN. This works best for read-only data, but with careful planning can be
 
323
        implemented so that modified files get replicated back to the point of origin. Be careful with your
 
324
        implementation if you choose to permit modification and return replication of the modified file;
 
325
        otherwise, you may inadvertently overwrite important data.
 
326
        </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2620581"></a>Hardware Problems</h3></div></div></div><p>
 
327
        <a class="indexterm" name="id2620588"></a>
 
328
        <a class="indexterm" name="id2620595"></a>
 
329
        <a class="indexterm" name="id2620602"></a>
 
330
        <a class="indexterm" name="id2620609"></a>
 
331
        <a class="indexterm" name="id2620618"></a>
 
332
        <a class="indexterm" name="id2620628"></a>
 
333
        Networking hardware prices have fallen sharply over the past 5 years. A surprising number
 
334
        of Samba networking problems over this time have been traced to defective network interface
 
335
        cards (NICs) or defective HUBs, switches, and cables.
 
336
        </p><p>
 
337
        <a class="indexterm" name="id2620644"></a>
 
338
        Not surprising is the fact that network administrators do not like to be shown to have made
 
339
        a bad decision. Money saved in buying low-cost hardware may result in high costs incurred
 
340
        in corrective action.
 
341
        </p><p>
 
342
        <a class="indexterm" name="id2620658"></a>
 
343
        <a class="indexterm" name="id2620665"></a>
 
344
        <a class="indexterm" name="id2620672"></a>
 
345
        <a class="indexterm" name="id2620679"></a>
 
346
        <a class="indexterm" name="id2620686"></a>
 
347
        Defective NICs, HUBs, and switches may appear as intermittent network access problems, intermittent
 
348
        or persistent data corruption, slow network throughput, low performance, or even as BSOD
 
349
        problems with MS Windows clients. In one case, a company updated several workstations with newer, faster
 
350
        Windows client machines that triggered problems during logon as well as data integrity problems on
 
351
        an older PC that was unaffected so long as the new machines were kept shut down.
 
352
        </p><p>
 
353
        Defective hardware problems may take patience and persistence before the real cause can be discovered.
 
354
        </p><p>
 
355
        <a class="indexterm" name="id2620709"></a>
 
356
        Networking hardware defects can significantly impact perceived Samba performance, but defective
 
357
        RAID controllers as well as SCSI and IDE hard disk controllers have also been known to impair Samba server
 
358
        operations. One business came to this realization only after replacing a Samba installation with MS 
 
359
        Windows Server 2000 running on the same hardware. The root of the problem completely eluded the network
 
360
        administrator until the entire server was replaced. While you may well think that this would never
 
361
        happen to you, experience shows that given the right (unfortunate) circumstances, this can happen to anyone.
 
362
        </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2620728"></a>Large Directories</h3></div></div></div><p>
 
363
        There exist applications that create or manage directories containing many thousands of files. Such
 
364
        applications typically generate many small files (less than 100 KB). At the best of times, under UNIX,
 
365
        listing of the files in a directory that contains many files is slow. By default, Windows NT, 200x, 
 
366
        and XP Pro cause network file system directory lookups on a Samba server to be performed for both 
 
367
        the case preserving file name as well as for the mangled (8.3) file name. This incurs a huge overhead
 
368
        on the Samba server that may slow down the system dramatically.
 
369
        </p><p>
 
370
        In an extreme case, the performance impact was dramatic. File transfer from the Samba server to a Windows
 
371
        XP Professional workstation over 1 Gigabit Ethernet for 250-500 KB files was measured at approximately
 
372
        30 MB/sec. But when tranferring a directory containing 120,000 files, all from 50KB to 60KB in size, the
 
373
        transfer rate to the same workstation was measured at approximately 1.5 KB/sec. The net transfer was
 
374
        on the order of a factor of 20-fold slower.
 
375
        </p><p>
 
376
        The symptoms that will be observed on the Samba server when a large directory is accessed will be that
 
377
        aggregate I/O (typically blocks read) will be relatively low, yet the wait I/O times will be incredibly
 
378
        long while at the same time the read queue is large. Close observation will show that the hard drive
 
379
        that the file system is on will be thrashing wildly.
 
380
        </p><p>
 
381
        Samba-3.0.12 and later, includes new code that radically improves Samba perfomance. The secret to this is
 
382
        really in the <a class="link" href="smb.conf.5.html#CASESENSITIVE" target="_top">case sensitive = True</a> line. This tells smbd never to scan
 
383
        for case-insensitive versions of names. So if an application asks for a file called <code class="filename">FOO</code>,
 
384
        and it can not be found by a simple stat call, then smbd will return "file not found" immediately without
 
385
        scanning the containing directory for a version of a different case.
 
386
        </p><p>
 
387
        Canonicalize all the files in the directory to have one case, upper or lower - either will do. Then set up 
 
388
        a new custom share for the application as follows:
 
389
        </p><pre class="screen">
 
390
        [bigshare]
 
391
                        path = /data/xrayfiles/neurosurgeons/
 
392
                        read only = no
 
393
                        case sensitive = True
 
394
                        default case = upper
 
395
                        preserve case = no
 
396
                        short preserve case = no
 
397
        </pre><p>
 
398
        </p><p>
 
399
        All files and directories under the <em class="parameter"><code>path</code></em> directory must be in the same case
 
400
        as specified in the <code class="filename">smb.conf</code> stanza. This means that smbd will not be able to find lower case 
 
401
        filenames with these settings.  Note, this is done on a per-share basis.
 
402
        </p></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2620832"></a>Key Points Learned</h2></div></div></div><p>
 
403
        This chapter has touched in broad sweeps on a number of simple steps that can be taken
 
404
        to ensure that your Samba network is resilient, scalable, and reliable, and that it
 
405
        performs well.
 
406
        </p><p>
 
407
        Always keep in mind that someone is responsible to maintain and manage your design.
 
408
        In the long term, that may not be you. Spare a thought for your successor and give him or
 
409
        her an even break.
 
410
        </p><p>
 
411
        <a class="indexterm" name="id2620853"></a>
 
412
        Last, but not least, you should not only keep the network design simple, but also be sure it is
 
413
        well documented. This book may serve as your pattern for documenting every
 
414
        aspect of your design, its implementation, and particularly the objects and assumptions
 
415
        that underlie it.
 
416
        </p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="DomApps.html">Prev</a>�</td><td width="20%" align="center"><a accesskey="u" href="RefSection.html">Up</a></td><td width="40%" align="right">�<a accesskey="n" href="ch14.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter�12.�Integrating Additional Services�</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">�Chapter�14.�Samba Support</td></tr></table></div></body></html>