- Timestamp:
- May 27, 2009, 9:08:03 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/samba-3.2.x/docs/htmldocs/Samba3-HOWTO/largefile.html
r226 r231 1 <html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Chapter 33. Handling Large Directories</title><link rel="stylesheet" href="../samba.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.7 3.1"><link rel="start" href="index.html" title="The Official Samba 3.2.x HOWTO and Reference Guide"><link rel="up" href="optional.html" title="Part III. Advanced Configuration"><link rel="prev" href="SambaHA.html" title="Chapter 32. High Availability"><link rel="next" href="cfgsmarts.html" title="Chapter 34. Advanced Configuration Techniques"></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 33. Handling Large Directories</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="SambaHA.html">Prev</a> </td><th width="60%" align="center">Part III. Advanced Configuration</th><td width="20%" align="right"> <a accesskey="n" href="cfgsmarts.html">Next</a></td></tr></table><hr></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="largefile"></a>Chapter 33. Handling Large Directories</h2></div><div><div class="author"><h3 class="author"><span class="firstname">Jeremy</span> <span class="surname">Allison</span></h3><div class="affiliation"><span class="orgname">Samba Team<br></span><div class="address"><p><code class="email"><<a class="email" href="mailto:jra@samba.org">jra@samba.org</a>></code></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><code class="email"><<a class="email" href="mailto:jht@samba.org">jht@samba.org</a>></code></p></div></div></div></div><div><p class="pubdate">March 5, 2005</p></div></div></div><p>2 <a class="indexterm" name="id26 66361"></a>3 <a class="indexterm" name="id26 66368"></a>4 <a class="indexterm" name="id26 66375"></a>1 <html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Chapter 33. Handling Large Directories</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="The Official Samba 3.2.x HOWTO and Reference Guide"><link rel="up" href="optional.html" title="Part III. Advanced Configuration"><link rel="prev" href="SambaHA.html" title="Chapter 32. High Availability"><link rel="next" href="cfgsmarts.html" title="Chapter 34. Advanced Configuration Techniques"></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 33. Handling Large Directories</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="SambaHA.html">Prev</a> </td><th width="60%" align="center">Part III. Advanced Configuration</th><td width="20%" align="right"> <a accesskey="n" href="cfgsmarts.html">Next</a></td></tr></table><hr></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="largefile"></a>Chapter 33. Handling Large Directories</h2></div><div><div class="author"><h3 class="author"><span class="firstname">Jeremy</span> <span class="orgname">Samba Team</span> <span class="surname">Allison</span></h3><div class="affiliation"><span class="orgname">Samba Team<br></span><div class="address"><p><code class="email"><<a class="email" href="mailto:jra@samba.org">jra@samba.org</a>></code></p></div></div></div></div><div><div class="author"><h3 class="author"><span class="firstname">John</span> <span class="othername">H.</span> <span class="orgname">Samba Team</span> <span class="surname">Terpstra</span></h3><div class="affiliation"><span class="orgname">Samba Team<br></span><div class="address"><p><code class="email"><<a class="email" href="mailto:jht@samba.org">jht@samba.org</a>></code></p></div></div></div></div><div><p class="pubdate">March 5, 2005</p></div></div></div><p> 2 <a class="indexterm" name="id2673351"></a> 3 <a class="indexterm" name="id2673358"></a> 4 <a class="indexterm" name="id2673365"></a> 5 5 Samba-3.0.12 and later implements a solution for sites that have experienced performance degradation due to the 6 6 problem of using Samba-3 with applications that need large numbers of files (100,000 or more) per directory. 7 7 </p><p> 8 <a class="indexterm" name="id26 66389"></a>9 <a class="indexterm" name="id26 66396"></a>8 <a class="indexterm" name="id2673379"></a> 9 <a class="indexterm" name="id2673386"></a> 10 10 The key was fixing the directory handling to read only the current list requested instead of the old 11 11 (up to samba-3.0.11) behavior of reading the entire directory into memory before doling out names. … … 13 13 stealing logic from Samba4 (thanks, Tridge), the current code in 3.0.12 handles this correctly. 14 14 </p><p> 15 <a class="indexterm" name="id26 66413"></a>16 <a class="indexterm" name="id26 66420"></a>15 <a class="indexterm" name="id2673404"></a> 16 <a class="indexterm" name="id2673410"></a> 17 17 To set up an application that needs large numbers of files per directory in a way that does not 18 18 damage performance unduly, follow these steps: 19 19 </p><p> 20 <a class="indexterm" name="id26 66433"></a>20 <a class="indexterm" name="id2673423"></a> 21 21 First, you need to canonicalize all the files in the directory to have one case, upper or lower take your 22 22 pick (I chose upper because all my files were already uppercase names). Then set up a new custom share for the 23 23 application as follows: 24 </p><table class="simplelist" border="0" summary="Simple list"><tr><td> </td></tr><tr><td><em class="parameter"><code>[bigshare]</code></em></td></tr><tr><td><a class="indexterm" name="id26 66461"></a><em class="parameter"><code>path = /data/manyfilesdir</code></em></td></tr><tr><td><a class="indexterm" name="id2666472"></a><em class="parameter"><code>read only = no</code></em></td></tr><tr><td><a class="indexterm" name="id2666484"></a><em class="parameter"><code>case sensitive = True</code></em></td></tr><tr><td><a class="indexterm" name="id2666496"></a><em class="parameter"><code>default case = upper</code></em></td></tr><tr><td><a class="indexterm" name="id2666508"></a><em class="parameter"><code>preserve case = no</code></em></td></tr><tr><td><a class="indexterm" name="id2666520"></a><em class="parameter"><code>short preserve case = no</code></em></td></tr></table><p>24 </p><table class="simplelist" border="0" summary="Simple list"><tr><td> </td></tr><tr><td><em class="parameter"><code>[bigshare]</code></em></td></tr><tr><td><a class="indexterm" name="id2673451"></a><em class="parameter"><code>path = /data/manyfilesdir</code></em></td></tr><tr><td><a class="indexterm" name="id2673463"></a><em class="parameter"><code>read only = no</code></em></td></tr><tr><td><a class="indexterm" name="id2673474"></a><em class="parameter"><code>case sensitive = True</code></em></td></tr><tr><td><a class="indexterm" name="id2673486"></a><em class="parameter"><code>default case = upper</code></em></td></tr><tr><td><a class="indexterm" name="id2673498"></a><em class="parameter"><code>preserve case = no</code></em></td></tr><tr><td><a class="indexterm" name="id2673510"></a><em class="parameter"><code>short preserve case = no</code></em></td></tr></table><p> 25 25 </p><p> 26 <a class="indexterm" name="id26 66535"></a>27 <a class="indexterm" name="id26 66542"></a>28 <a class="indexterm" name="id26 66548"></a>26 <a class="indexterm" name="id2673525"></a> 27 <a class="indexterm" name="id2673532"></a> 28 <a class="indexterm" name="id2673539"></a> 29 29 Of course, use your own path and settings, but set the case options to match the case of all the files in your 30 30 directory. The path should point at the large directory needed for the application any new files created in … … 32 32 the directory for names: it knows that if a file does not exist in uppercase, then it doesn't exist at all. 33 33 </p><p> 34 <a class="indexterm" name="id26 66569"></a>35 <a class="indexterm" name="id26 66575"></a>36 <a class="indexterm" name="id26 66582"></a>37 The secret to this is really in the <a class="link" href="smb.conf.5.html#CASESENSITIVE" >case sensitive = True</a>34 <a class="indexterm" name="id2673559"></a> 35 <a class="indexterm" name="id2673566"></a> 36 <a class="indexterm" name="id2673572"></a> 37 The secret to this is really in the <a class="link" href="smb.conf.5.html#CASESENSITIVE" target="_top">case sensitive = True</a> 38 38 line. This tells smbd never to scan for case-insensitive versions of names. So if an application asks for a file 39 39 called <code class="filename">FOO</code>, and it cannot be found by a simple stat call, then smbd will return file not … … 42 42 <span class="application">smbd</span>. 43 43 </p><p> 44 <a class="indexterm" name="id26 66629"></a>45 <a class="indexterm" name="id26 66636"></a>46 <a class="indexterm" name="id26 66642"></a>44 <a class="indexterm" name="id2673619"></a> 45 <a class="indexterm" name="id2673626"></a> 46 <a class="indexterm" name="id2673633"></a> 47 47 Remember, all files and directories under the <em class="parameter"><code>path</code></em> directory must be in uppercase 48 48 with this <code class="filename">smb.conf</code> stanza because <span class="application">smbd</span> will not be able to find lowercase filenames with these settings. Also
Note:
See TracChangeset
for help on using the changeset viewer.