Whamcloud - gitweb
LUDOC-102 format-options: Fixed inode ratio description. Also addressed LUDOC-49.
[doc/manual.git] / SettingUpLustreSystem.xml
1 <?xml version='1.0' encoding='UTF-8'?>
2 <chapter xmlns="http://docbook.org/ns/docbook" xmlns:xl="http://www.w3.org/1999/xlink" version="5.0" xml:lang="en-US" xml:id="settinguplustresystem">
3   <title xml:id="settinguplustresystem.title">Determining Hardware Configuration Requirements and
4     Formatting Options</title>
5   <para>This chapter describes hardware configuration requirements for a Lustre* file system
6     including:</para>
7   <itemizedlist>
8     <listitem>
9       <para>
10           <xref linkend="dbdoclet.50438256_49017"/>
11       </para>
12     </listitem>
13     <listitem>
14       <para>
15           <xref linkend="dbdoclet.50438256_31079"/>
16       </para>
17     </listitem>
18     <listitem>
19       <para>
20           <xref linkend="dbdoclet.50438256_84701"/>
21       </para>
22     </listitem>
23     <listitem>
24       <para>
25           <xref linkend="dbdoclet.50438256_26456"/>
26       </para>
27     </listitem>
28     <listitem>
29       <para>
30           <xref linkend="dbdoclet.50438256_78272"/>
31       </para>
32     </listitem>
33   </itemizedlist>
34   <section xml:id="dbdoclet.50438256_49017">
35       <title><indexterm><primary>setup</primary></indexterm>
36   <indexterm><primary>setup</primary><secondary>hardware</secondary></indexterm>        
37   <indexterm><primary>design</primary><see>setup</see></indexterm>        
38           Hardware Considerations</title>
39     <para>A Lustre file system can utilize any kind of block storage device such as single disks,
40       software RAID, hardware RAID, or a logical volume manager. In contrast to some networked file
41       systems, the block devices are only attached to the MDS and OSS nodes in a Lustre file system
42       and are not accessed by the clients directly.</para>
43     <para>Since the block devices are accessed by only one or two server nodes, a storage area network (SAN) that is accessible from all the servers is not required. Expensive switches are not needed because point-to-point connections between the servers and the storage arrays normally provide the simplest and best attachments. (If failover capability is desired, the storage must be attached to multiple servers.)</para>
44     <para>For a production environment, it is preferable that the MGS have separate storage to allow future expansion to multiple file systems. However, it is possible to run the MDS and MGS on the same machine and have them share the same storage device.</para>
45     <para>For best performance in a production environment, dedicated clients are required. For a non-production Lustre environment or for testing, a Lustre client and server can run on the same machine. However, dedicated clients are the only supported configuration.</para>
46     <para>Performance and other issues can occur when an MDS or OSS and a client are running on the same machine:</para>
47     <itemizedlist>
48       <listitem>
49         <para>Running the MDS and a client on the same machine can cause recovery and deadlock issues and impact the performance of other Lustre clients.</para>
50       </listitem>
51       <listitem>
52         <para>Running the OSS and a client on the same machine can cause issues with low memory and memory pressure. If the client consumes all the memory and then tries to write data to the file system, the OSS will need to allocate pages to receive data from the client but will not be able to perform this operation due to low memory. This can cause the client to hang.</para>
53       </listitem>
54     </itemizedlist>
55     <para>Only servers running on 64-bit CPUs are tested and supported. 64-bit CPU clients are
56       typically used for testing to match expected customer usage and avoid limitations due to the 4
57       GB limit for RAM size, 1 GB low-memory limitation, and 16 TB file size limit of 32-bit CPUs.
58       Also, due to kernel API limitations, performing backups of Lustre 2.x. file systems on 32-bit
59       clients may cause backup tools to confuse files that have the same 32-bit inode number.</para>
60     <para>The storage attached to the servers typically uses RAID to provide fault tolerance and can
61       optionally be organized with logical volume management (LVM), which is then formatted as a
62       Lustre file system. Lustre OSS and MDS servers read, write and modify data in the format
63       imposed by the file system.</para>
64     <para>The Lustre file system uses journaling file system technology on both the MDTs and OSTs.
65       For a MDT, as much as a 20 percent performance gain can be obtained by placing the journal on
66       a separate device.</para>
67     <para>The MDS can effectively utilize a lot of CPU cycles. A minimum of four processor cores are recommended. More are advisable for files systems with many clients.</para>
68     <note>
69       <para>Lustre clients running on architectures with different endianness are supported. One limitation is that the PAGE_SIZE kernel macro on the client must be as large as the PAGE_SIZE of the server. In particular, ia64 or PPC clients with large pages (up to 64kB pages) can run with x86 servers (4kB pages). If you are running x86 clients with ia64 or PPC servers, you must compile the ia64 kernel with a 4kB PAGE_SIZE (so the server page size is not larger than the client page size). </para>
70     </note>
71     <section remap="h3">
72         <title><indexterm><primary>setup</primary><secondary>MDT</secondary></indexterm>
73             MDT Storage Hardware Considerations</title>
74       <para>The data access pattern for MDS storage is a database-like access pattern with many seeks and read-and-writes of small amounts of data. High throughput to MDS storage is not important. Storage types that provide much lower seek times, such as high-RPM SAS or SSD drives can be used for the MDT.</para>
75       <para>For maximum performance, the MDT should be configured as RAID1 with an internal journal and two disks from different controllers.</para>
76       <para>If you need a larger MDT, create multiple RAID1 devices from pairs of disks, and then make a RAID0 array of the RAID1 devices. This ensures maximum reliability because multiple disk failures only have a small chance of hitting both disks in the same RAID1 device.</para>
77       <para>Doing the opposite (RAID1 of a pair of RAID0 devices) has a 50% chance that even two disk failures can cause the loss of the whole MDT device. The first failure disables an entire half of the mirror and the second failure has a 50% chance of disabling the remaining mirror.</para>
78       <para condition='l24'>If multiple MDTs are going to be present in the system, each MDT should be specified for the anticipated usage and load.</para>
79       <warning condition='l24'><para>MDT0 contains the root of the Lustre file system. If MDT0 is unavailable for any reason, the
80           file system cannot be used.</para></warning>
81       <note condition='l24'><para>Additional MDTs can be dedicated to sub-directories off the root file system provided by MDT0.
82           Subsequent directories may also be configured to have their own MDT. If an MDT serving a
83           subdirectory becomes unavailable this subdirectory and all directories beneath it will
84           also become unavailable. Configuring multiple levels of MDTs is an experimental feature
85           for the Lustre 2.4 release.</para></note>
86     </section>
87     <section remap="h3">
88       <title><indexterm><primary>setup</primary><secondary>OST</secondary></indexterm>OST Storage Hardware Considerations</title>
89       <para>The data access pattern for the OSS storage is a streaming I/O pattern that is dependent on the access patterns of applications being used. Each OSS can manage multiple object storage targets (OSTs), one for each volume with I/O traffic load-balanced between servers and targets. An OSS should be configured to have a balance between the network bandwidth and the attached storage bandwidth to prevent bottlenecks in the I/O path. Depending on the server hardware, an OSS typically serves between 2 and 8 targets, with each target up to 128 terabytes (TBs) in size.</para>
90       <para>Lustre file system capacity is the sum of the capacities provided by the targets. For
91         example, 64 OSSs, each with two 8 TB targets, provide a file system with a capacity of
92         nearly 1 PB. If each OST uses ten 1 TB SATA disks (8 data disks plus 2 parity disks in a
93         RAID 6 configuration), it may be possible to get 50 MB/sec from each drive, providing up to
94         400 MB/sec of disk bandwidth per OST. If this system is used as storage backend with a
95         system network, such as the InfiniBand* network, that provides a similar bandwidth, then
96         each OSS could provide 800 MB/sec of end-to-end I/O throughput. (Although the architectural
97         constraints described here are simple, in practice it takes careful hardware selection,
98         benchmarking and integration to obtain such results.)</para>
99     </section>
100   </section>
101   <section xml:id="dbdoclet.50438256_31079">
102       <title><indexterm><primary>setup</primary><secondary>space</secondary></indexterm>
103           <indexterm><primary>space</primary><secondary>determining requirements</secondary></indexterm>
104           Determining Space Requirements</title>
105     <para>The desired performance characteristics of the backing file systems on the MDT and OSTs are independent of one another. The size of the MDT backing file system depends on the number of inodes needed in the total Lustre file system, while the aggregate OST space depends on the total amount of data stored on the file system.</para>
106     <para>Each time a file is created on a Lustre file system, it consumes one inode on the MDT and one inode for each OST object over which the file is striped. Normally, each file&apos;s stripe count is based on the system-wide default stripe count. However, this can be changed for individual files using the <literal>lfs setstripe</literal> option. For more details, see <xref linkend="managingstripingfreespace"/>.</para>
107     <para>In a Lustre ldiskfs file system, all the inodes are allocated on the MDT and OSTs when the file system is first formatted. The total number of inodes on a formatted MDT or OST cannot be easily changed, although it is possible to add OSTs with additional space and corresponding inodes. Thus, the number of inodes created at format time should be generous enough to anticipate future expansion.</para>
108     <para>When the file system is in use and a file is created, the metadata associated with that file is stored in one of the pre-allocated inodes and does not consume any of the free space used to store file data.</para>
109     <note>
110       <para>By default, the ldiskfs file system used by Lustre servers to store user-data objects
111         and system data reserves 5% of space that cannot be used by the Lustre file system.
112         Additionally, a Lustre file system reserves up to 400 MB on each OST for journal use and a
113         small amount of space outside the journal to store accounting data. This reserved space is
114         unusable for general storage. Thus, at least 400 MB of space is used on each OST before any
115         file object data is saved.</para>
116     </note>
117     <section xml:id="dbdoclet.50438256_87676">
118         <title><indexterm><primary>setup</primary><secondary>MDS/MDT</secondary></indexterm>
119           <indexterm><primary>space</primary><secondary>determining MDS/MDT requirements</secondary></indexterm>
120       Determining MDS/MDT Space Requirements</title>
121       <para>When calculating the MDT size, the important factor to consider is the number of files to be stored in the file system. This determines the number of inodes needed, which drives the MDT sizing. To be on the safe side, plan for 2 KB per inode on the MDT, which is the default value. Attached storage required for Lustre metadata is typically 1-2 percent of the file system capacity depending upon file size.</para>
122       <para>For example, if the average file size is 5 MB and you have 100 TB of usable OST space, then you can calculate the minimum number of inodes as follows:</para>
123       <informalexample>
124         <para>(100 TB * 1024 GB/TB * 1024 MB/GB) / 5 MB/inode = 20 million inodes</para>
125       </informalexample>
126       <para>We recommend that you use at least twice the minimum number of inodes to allow for future expansion and allow for an average file size smaller than expected. Thus, the required space is:</para>
127       <informalexample>
128         <para>2 KB/inode * 40 million inodes = 80 GB</para>
129       </informalexample>
130       <para>If the average file size is small, 4 KB for example, the Lustre file system is not very
131         efficient as the MDT uses as much space as the OSTs. However, this is not a common
132         configuration for a Lustre environment.</para>
133       <note>
134         <para>If the MDT is too small, this can cause all the space on the OSTs to be unusable. Be sure to determine the appropriate size of the MDT needed to support the file system before formatting the file system. It is difficult to increase the number of inodes after the file system is formatted.</para>
135       </note>
136     </section>
137     <section remap="h3">
138         <title><indexterm><primary>setup</primary><secondary>OSS/OST</secondary></indexterm>
139           <indexterm><primary>space</primary><secondary>determining OSS/OST requirements</secondary></indexterm>
140       Determining OSS/OST Space Requirements</title>
141       <para>For the OST, the amount of space taken by each object depends on the usage pattern of
142         the users/applications running on the system. The Lustre software defaults to a conservative
143         estimate for the object size (16 KB per object). If you are confident that the average file
144         size for your applications will be larger than this, you can specify a larger average file
145         size (fewer total inodes) to reduce file system overhead and minimize file system check
146         time. See <xref linkend="dbdoclet.50438256_53886"/> for more details.</para>
147     </section>
148   </section>
149   <section xml:id="dbdoclet.50438256_84701">
150       <title>
151           <indexterm><primary>file system</primary><secondary>formatting options</secondary></indexterm>
152           <indexterm><primary>setup</primary><secondary>file system</secondary></indexterm>
153           Setting File System Formatting Options</title>
154     <para>By default, the <literal>mkfs.lustre</literal> utility applies these options to the Lustre
155       backing file system used to store data and metadata in order to enhance Lustre file system
156       performance and scalability. These options include:</para>
157         <itemizedlist>
158             <listitem>
159               <para><literal>flex_bg</literal> - When the flag is set to enable this
160           flexible-block-groups feature, block and inode bitmaps for multiple groups are aggregated
161           to minimize seeking when bitmaps are read or written and to reduce read/modify/write
162           operations on typical RAID storage (with 1 MB RAID stripe widths). This flag is enabled on
163           both OST and MDT file systems. On MDT file systems the <literal>flex_bg</literal> factor
164           is left at the default value of 16. On OSTs, the <literal>flex_bg</literal> factor is set
165           to 256 to allow all of the block or inode bitmaps in a single <literal>flex_bg</literal>
166           to be read or written in a single I/O on typical RAID storage.</para>
167             </listitem>
168             <listitem>
169               <para><literal>huge_file</literal> - Setting this flag allows files on OSTs to be
170           larger than 2 TB in size.</para>
171             </listitem>
172             <listitem>
173               <para><literal>lazy_journal_init</literal> - This extended option is enabled to
174           prevent a full overwrite of the 400 MB journal that is allocated by default in a Lustre
175           file system, which reduces the file system format time.</para>
176             </listitem>
177         </itemizedlist>
178     <para>To override the default formatting options, use arguments to
179         <literal>mkfs.lustre</literal> to pass formatting options to the backing file system:</para>
180     <screen>--mkfsoptions=&apos;backing fs options&apos;</screen>
181     <para>For other <literal>mkfs.lustre</literal> options, see the Linux* man page for
182         <literal>mke2fs(8)</literal>.</para>
183     <section xml:id="dbdoclet.50438256_pgfId-1293228">
184       <title><indexterm>
185           <primary>inodes</primary>
186           <secondary>MDS</secondary>
187         </indexterm><indexterm>
188           <primary>setup</primary>
189           <secondary>inodes</secondary>
190         </indexterm>Setting Formatting Options for an MDT</title>
191       <para>The number of inodes on the MDT is determined at format time based on the total size of
192         the file system to be created. The default <emphasis role="italic"
193           >bytes-per-inode</emphasis> ratio ("inode ratio") for an MDT is optimized at one inode for
194         every 2048 bytes of file system space. It is recommended that this value not be changed for
195         MDTs.</para>
196       <para>This setting takes into account the space needed for additional metadata, such as the
197         journal (up to 400 MB), bitmaps and directories, and a few files that the Lustre file system
198         uses to maintain cluster consistency.</para>
199     </section>
200     <section xml:id="dbdoclet.50438256_53886">
201       <title><indexterm>
202           <primary>inodes</primary>
203           <secondary>OST</secondary>
204         </indexterm>Setting Formatting Options for an OST</title>
205       <para>When formatting OST file systems, it is normally advantageous to take local file system
206         usage into account. When doing so, try to minimize the number of inodes on each OST, while
207         keeping enough margin for potential variations in future usage. This helps reduce the format
208         and file system check time and makes more space available for data.</para>
209       <para>The table below shows the default <emphasis role="italic">bytes-per-inode
210         </emphasis>ratio ("inode ratio") used for OSTs of various sizes when they are formatted. </para>
211       <para>
212         <table frame="all">
213           <title xml:id="settinguplustresystem.tab1">Inode Ratios Used for Newly Formatted
214             OSTs</title>
215           <tgroup cols="3">
216             <colspec colname="c1" colwidth="3*"/>
217             <colspec colname="c2" colwidth="2*"/>
218             <colspec colname="c3" colwidth="4*"/>
219             <thead>
220               <row>
221                 <entry>
222                   <para><emphasis role="bold">LUN/OST size</emphasis></para>
223                 </entry>
224                 <entry>
225                   <para><emphasis role="bold">Inode ratio</emphasis></para>
226                 </entry>
227                 <entry>
228                   <para><emphasis role="bold">Total inodes</emphasis></para>
229                 </entry>
230               </row>
231             </thead>
232             <tbody>
233               <row>
234                 <entry>
235                   <para> over 10GB </para>
236                 </entry>
237                 <entry>
238                   <para> 1 inode/16KB </para>
239                 </entry>
240                 <entry>
241                   <para> 640 - 655k </para>
242                 </entry>
243               </row>
244               <row>
245                 <entry>
246                   <para> 10GB - 1TB </para>
247                 </entry>
248                 <entry>
249                   <para> 1 inode/68kiB </para>
250                 </entry>
251                 <entry>
252                   <para> 153k - 15.7M </para>
253                 </entry>
254               </row>
255               <row>
256                 <entry>
257                   <para> 1TB - 8TB </para>
258                 </entry>
259                 <entry>
260                   <para> 1 inode/256kB </para>
261                 </entry>
262                 <entry>
263                   <para> 4.2M - 33.6M </para>
264                 </entry>
265               </row>
266               <row>
267                 <entry>
268                   <para> over 8TB </para>
269                 </entry>
270                 <entry>
271                   <para> 1 inode/1MB </para>
272                 </entry>
273                 <entry>
274                   <para> 8.4M - 134M </para>
275                 </entry>
276               </row>
277             </tbody>
278           </tgroup>
279         </table>
280       </para>
281       <para>In environments with few small files, the default inode ratio may result in far too many
282         inodes for the average file size. In this case, performance can be improved by increasing
283         the number of <emphasis role="italic">bytes-per-inode</emphasis>.To set the inode ratio, use
284         the <literal>-i</literal> argument to <literal>mkfs.lustre</literal> to specify the
285           <emphasis role="italic">bytes-per-inode</emphasis> value. </para>
286       <note>
287         <para>File system check time on OSTs is affected by a number of  variables in addition to
288           the number of inodes, including the size of the file system, the number of allocated
289           blocks, the distribution of allocated blocks on the disk, disk speed, CPU speed, and the
290           amount of RAM on the server. Reasonable file system check times are 5-30 minutes per
291           TB.</para>
292       </note>
293       <para>For more details about formatting MDT and OST file systems, see <xref
294           linkend="dbdoclet.50438208_51921"/>.</para>
295     </section>
296     <section remap="h3">
297       <title><indexterm>
298           <primary>setup</primary>
299           <secondary>limits</secondary>
300         </indexterm><indexterm xmlns:xi="http://www.w3.org/2001/XInclude">
301           <primary>wide striping</primary>
302         </indexterm><indexterm xmlns:xi="http://www.w3.org/2001/XInclude">
303           <primary>xattr</primary>
304           <secondary><emphasis role="italic">See</emphasis> wide striping</secondary>
305         </indexterm>File and File System Limits</title>
306       <para><xref linkend="settinguplustresystem.tab2"/> describes file and file system size limits.
307         These limits are imposed by either the Lustre architecture or the Linux virtual file system
308         (VFS) and virtual memory subsystems. In a few cases, a limit is defined within the code and
309         can be changed by re-compiling the Lustre software (see <xref
310           linkend="installinglustrefromsourcecode"/>). In these cases, the indicated limit was used
311         for testing of the Lustre software. </para>
312       <table frame="all">
313         <title xml:id="settinguplustresystem.tab2">File and file system limits</title>
314         <tgroup cols="3">
315           <colspec colname="c1" colwidth="3*"/>
316           <colspec colname="c2" colwidth="2*"/>
317           <colspec colname="c3" colwidth="4*"/>
318           <thead>
319             <row>
320               <entry>
321                 <para><emphasis role="bold">Limit</emphasis></para>
322               </entry>
323               <entry>
324                 <para><emphasis role="bold">Value</emphasis></para>
325               </entry>
326               <entry>
327                 <para><emphasis role="bold">Description</emphasis></para>
328               </entry>
329             </row>
330           </thead>
331           <tbody>
332             <row>
333               <entry>
334                 <para> Maximum number of MDTs</para>
335               </entry>
336               <entry>
337                 <para> 1</para>
338                 <para condition='l24'>4096</para>
339               </entry>
340               <entry>
341                 <para>The Lustre 2.3 release and earlier allows a maximum of 1 MDT per file system,
342                   but a single MDS can host multiple MDTs, each one for a separate file
343                   system.</para>
344                 <para condition="l24">The Lustre 2.4 release and later requires one MDT for the
345                   root. Upto 4095 additional MDTs can be added to the file system and attached into
346                   the namespace with remote directories.</para>
347               </entry>
348             </row>
349             <row>
350               <entry>
351                 <para> Maximum number of OSTs</para>
352               </entry>
353               <entry>
354                 <para> 8150</para>
355               </entry>
356               <entry>
357                 <para>The maximum number of OSTs is a constant that can be changed at compile time.
358                   Lustre file systems with up to 4000 OSTs have been tested.</para>
359               </entry>
360             </row>
361             <row>
362               <entry>
363                 <para> Maximum OST size</para>
364               </entry>
365               <entry>
366                 <para> 128TB </para>
367               </entry>
368               <entry>
369                 <para>This is not a <emphasis>hard</emphasis> limit. Larger OSTs are possible but
370                   today typical production systems do not go beyond 128TB per OST. </para>
371               </entry>
372             </row>
373             <row>
374               <entry>
375                 <para> Maximum number of clients</para>
376               </entry>
377               <entry>
378                 <para> 131072</para>
379               </entry>
380               <entry>
381                 <para>The maximum number of clients is a constant that can be changed at compile time.</para>
382               </entry>
383             </row>
384             <row>
385               <entry>
386                 <para> Maximum size of a file system</para>
387               </entry>
388               <entry>
389                 <para> 512 PB</para>
390               </entry>
391               <entry>
392                 <para>Each OST or MDT on 64-bit kernel servers can have a file system up to 128 TB. On 32-bit systems, due to page cache limits, 16TB is the maximum block device size, which in turn applies to the size of OST on 32-bit kernel servers.</para>
393                 <para>You can have multiple OST file systems on a single OSS node.</para>
394               </entry>
395             </row>
396             <row>
397               <entry>
398                 <para> Maximum stripe count</para>
399               </entry>
400               <entry>
401                 <para> 2000</para>
402               </entry>
403               <entry>
404                 <para>This limit is imposed by the size of the layout that needs to be stored on disk and sent in RPC requests, but is not a hard limit of the protocol.</para>
405               </entry>
406             </row>
407             <row>
408               <entry>
409                 <para> Maximum stripe size</para>
410               </entry>
411               <entry>
412                 <para> &lt; 4 GB</para>
413               </entry>
414               <entry>
415                 <para>The amount of data written to each object before moving on to next object.</para>
416               </entry>
417             </row>
418             <row>
419               <entry>
420                 <para> Minimum stripe size</para>
421               </entry>
422               <entry>
423                 <para> 64 KB</para>
424               </entry>
425               <entry>
426                 <para>Due to the 64 KB PAGE_SIZE on some 64-bit machines, the minimum stripe size is set to 64 KB.</para>
427               </entry>
428             </row>
429             <row>              <entry>
430                 <para> Maximum object size</para>              </entry>
431               <entry>
432                 <para> 16 TB</para>
433               </entry>
434               <entry>
435                 <para>The amount of data that can be stored in a single object. An object
436                   corresponds to a stripe. The ldiskfs limit of 16 TB for a single object applies.
437                   Files can consist of up to 2000 stripes, each 16 TB in size. </para>
438               </entry>
439             </row>
440             <row>
441               <entry>
442                 <para> Maximum <anchor xml:id="dbdoclet.50438256_marker-1290761" xreflabel=""/>file size</para>
443               </entry>
444               <entry>
445                 <para> 16 TB on 32-bit systems</para>
446                 <para>&#160;</para>
447                 <para> 31.25 PB on 64-bit systems</para>
448               </entry>
449               <entry>
450                 <para>Individual files have a hard limit of nearly 16 TB on 32-bit systems imposed
451                   by the kernel memory subsystem. On 64-bit systems this limit does not exist.
452                   Hence, files can be 64-bits in size. An additional size limit of up to the number
453                   of stripes is imposed, where each stripe is 16 TB.</para>
454                 <para>A single file can have a maximum of 2000 stripes, which gives an upper single file limit of 31.25 PB for 64-bit systems. The actual amount of data that can be stored in a file depends upon the amount of free space in each OST on which the file is striped.</para>
455               </entry>
456             </row>
457             <row>
458               <entry>
459                 <para> Maximum number of files or subdirectories in a single directory</para>
460               </entry>
461               <entry>
462                 <para> 10 million files</para>
463               </entry>
464               <entry>
465                 <para>The Lustre software uses the ldiskfs hashed directory code, which has a limit
466                   of about 10 million files depending on the length of the file name. The limit on
467                   subdirectories is the same as the limit on regular files.</para>
468                 <para>Lustre file systems are tested with ten million files in a single
469                   directory.</para>
470               </entry>
471             </row>
472             <row>
473               <entry>
474                 <para> Maximum number of files in the file system</para>
475               </entry>
476               <entry>
477                 <para> 4 billion</para>
478                 <para condition='l24'>4096 * 4 billion</para>
479               </entry>
480               <entry>
481                 <para>The ldiskfs file system imposes an upper limit of 4 billion inodes. By default, the MDS file system is formatted with 2KB of space per inode, meaning 1 billion inodes per file system of 2 TB.</para>
482                 <para>This can be increased initially, at the time of MDS file system creation. For more information, see <xref linkend="settinguplustresystem"/>.</para>
483                                 <para condition="l24">Each additional MDT can hold up to 4 billion additional files, depending
484                   on available inodes and the distribution directories and files in the file
485                   system.</para>
486               </entry>
487             </row>
488             <row>
489               <entry>
490                 <para> Maximum length of a filename</para>
491               </entry>
492               <entry>
493                 <para> 255 bytes (filename)</para>
494               </entry>
495               <entry>
496                 <para>This limit is 255 bytes for a single filename, the same as in an ldiskfs file system.</para>
497               </entry>
498             </row>
499             <row>
500               <entry>
501                 <para> Maximum length of a pathname</para>
502               </entry>
503               <entry>
504                 <para> 4096 bytes (pathname)</para>
505               </entry>
506               <entry>
507                 <para>The Linux VFS imposes a full pathname length of 4096 bytes.</para>
508               </entry>
509             </row>
510             <row>
511               <entry>
512                 <para> Maximum number of open files for a Lustre file system</para>
513               </entry>
514               <entry>
515                 <para> None</para>
516               </entry>
517               <entry>
518                 <para>The Lustre software does not impose a maximum for the number of open files,
519                   but the practical limit depends on the amount of RAM on the MDS. No
520                   &quot;tables&quot; for open files exist on the MDS, as they are only linked in a
521                   list to a given client&apos;s export. Each client process probably has a limit of
522                   several thousands of open files which depends on the ulimit.</para>
523               </entry>
524             </row>
525           </tbody>
526         </tgroup>
527       </table>
528       <para>&#160;</para>
529       <note>
530         <para condition="l22">In Lustre releases prior to 2.2, the maximum stripe count for a single
531           file was limited to 160 OSTs. In Lustre release 2.2, the large <literal>xattr</literal>
532           feature ("wide striping") was added to support up to 2000 OSTs. This feature is disabled
533           by default at <literal>mkfs.lustre</literal> time. In order to enable this feature, set
534           the "<literal>-O large_xattr</literal>" option on the MDT either by using
535             <literal>--mkfsoptions</literal> at format time or by using
536           <literal>tune2fs</literal>.</para>
537       </note>
538     </section>
539   </section>
540   <section xml:id="dbdoclet.50438256_26456">
541     <title><indexterm><primary>setup</primary><secondary>memory</secondary></indexterm>Determining Memory Requirements</title>
542     <para>This section describes the memory requirements for each Lustre file system component.</para>
543     <section remap="h3">
544         <title>
545             <indexterm><primary>setup</primary><secondary>memory</secondary><tertiary>client</tertiary></indexterm>
546             Client Memory Requirements</title>
547       <para>A minimum of 2 GB RAM is recommended for clients.</para>
548     </section>
549     <section remap="h3">
550         <title><indexterm><primary>setup</primary><secondary>memory</secondary><tertiary>MDS</tertiary></indexterm>MDS Memory Requirements</title>
551       <para>MDS memory requirements are determined by the following factors:</para>
552       <itemizedlist>
553         <listitem>
554           <para>Number of clients</para>
555         </listitem>
556         <listitem>
557           <para>Size of the directories</para>
558         </listitem>
559         <listitem>
560           <para>Load placed on server</para>
561         </listitem>
562       </itemizedlist>
563       <para>The amount of memory used by the MDS is a function of how many clients are on the system, and how many files they are using in their working set. This is driven, primarily, by the number of locks a client can hold at one time. The number of locks held by clients varies by load and memory availability on the server. Interactive clients can hold in excess of 10,000 locks at times. On the MDS, memory usage is approximately 2 KB per file, including the Lustre distributed lock manager (DLM) lock and kernel data structures for the files currently in use. Having file data in cache can improve metadata performance by a factor of 10x or more compared to reading it from disk.</para>
564       <para>MDS memory requirements include:</para>
565       <itemizedlist>
566         <listitem>
567           <para><emphasis role="bold">File system metadata</emphasis> : A reasonable amount of RAM needs to be available for file system metadata. While no hard limit can be placed on the amount of file system metadata, if more RAM is available, then the disk I/O is needed less often to retrieve the metadata.</para>
568         </listitem>
569         <listitem>
570           <para><emphasis role="bold">Network transport</emphasis> : If you are using TCP or other network transport that uses system memory for send/receive buffers, this memory requirement must also be taken into consideration.</para>
571         </listitem>
572         <listitem>
573           <para><emphasis role="bold">Journal size</emphasis> : By default, the journal size is 400 MB for each Lustre ldiskfs file system. This can pin up to an equal amount of RAM on the MDS node per file system.</para>
574         </listitem>
575         <listitem>
576           <para><emphasis role="bold">Failover configuration</emphasis> : If the MDS node will be used for failover from another node, then the RAM for each journal should be doubled, so the backup server can handle the additional load if the primary server fails.</para>
577         </listitem>
578       </itemizedlist>
579       <section remap="h4">
580         <title><indexterm><primary>setup</primary><secondary>memory</secondary><tertiary>MDS</tertiary></indexterm>Calculating MDS Memory Requirements</title>
581         <para>By default, 400 MB are used for the file system journal. Additional RAM is used for caching file data for the larger working set, which is not actively in use by clients but should be kept &quot;hot&quot; for improved access times. Approximately 1.5 KB per file is needed to keep a file in cache without a lock.</para>
582         <para>For example, for a single MDT on an MDS with 1,000 clients, 16 interactive nodes, and a 2 million file working set (of which 400,000 files are cached on the clients):</para>
583         <informalexample>
584           <para>Operating system overhead = 512 MB</para>
585           <para>File system journal = 400 MB</para>
586           <para>1000 * 4-core clients * 100 files/core * 2kB = 800 MB</para>
587           <para>16 interactive clients * 10,000 files * 2kB = 320 MB</para>
588           <para>1,600,000 file extra working set * 1.5kB/file = 2400 MB</para>
589         </informalexample>
590         <para>Thus, the minimum requirement for a system with this configuration is at least 4 GB of RAM. However, additional memory may significantly improve performance.</para>
591         <para>For directories containing 1 million or more files, more memory may provide a significant benefit. For example, in an environment where clients randomly access one of 10 million files, having extra memory for the cache significantly improves performance.</para>
592       </section>
593     </section>
594     <section remap="h3">
595       <title><indexterm><primary>setup</primary><secondary>memory</secondary><tertiary>OSS</tertiary></indexterm>OSS Memory Requirements</title>
596       <para>When planning the hardware for an OSS node, consider the memory usage of several
597         components in the Lustre file system (i.e., journal, service threads, file system metadata,
598         etc.). Also, consider the effect of the OSS read cache feature, which consumes memory as it
599         caches data on the OSS node.</para>
600       <para>In addition to the MDS memory requirements mentioned in <xref linkend="dbdoclet.50438256_87676"/>, the OSS requirements include:</para>
601       <itemizedlist>
602         <listitem>
603           <para><emphasis role="bold">Service threads</emphasis> : The service threads on the OSS node pre-allocate a 4 MB I/O buffer for each ost_io service thread, so these buffers do not need to be allocated and freed for each I/O request.</para>
604         </listitem>
605         <listitem>
606           <para><emphasis role="bold">OSS read cache</emphasis> : OSS read cache provides read-only caching of data on an OSS, using the regular Linux page cache to store the data. Just like caching from a regular file system in Linux, OSS read cache uses as much physical memory as is available.</para>
607         </listitem>
608       </itemizedlist>
609       <para>The same calculation applies to files accessed from the OSS as for the MDS, but the load is distributed over many more OSSs nodes, so the amount of memory required for locks, inode cache, etc. listed under MDS is spread out over the OSS nodes.</para>
610       <para>Because of these memory requirements, the following calculations should be taken as determining the absolute minimum RAM required in an OSS node.</para>
611       <section remap="h4">
612         <title><indexterm><primary>setup</primary><secondary>memory</secondary><tertiary>OSS</tertiary></indexterm>Calculating OSS Memory Requirements</title>
613         <para>The minimum recommended RAM size for an OSS with two OSTs is computed below:</para>
614         <informalexample>
615           <para>Ethernet/TCP send/receive buffers (4 MB * 512 threads) = 2048 MB</para>
616           <para>400 MB journal size * 2 OST devices = 800 MB</para>
617           <para>1.5 MB read/write per OST IO thread * 512 threads = 768 MB</para>
618           <para>600 MB file system read cache * 2 OSTs = 1200 MB</para>
619           <para>1000 * 4-core clients * 100 files/core * 2kB = 800MB</para>
620           <para>16 interactive clients * 10,000 files * 2kB = 320MB</para>
621           <para>1,600,000 file extra working set * 1.5kB/file = 2400MB</para>
622           <para> DLM locks + file system metadata TOTAL = 3520MB</para>
623           <para>Per OSS DLM locks + file system metadata = 3520MB/6 OSS = 600MB (approx.)</para>
624           <para>Per OSS RAM minimum requirement = 4096MB (approx.)</para>
625         </informalexample>
626         <para>This consumes about 1,400 MB just for the pre-allocated buffers, and an additional 2 GB for minimal file system and kernel usage. Therefore, for a non-failover configuration, the minimum RAM would be 4 GB for an OSS node with two OSTs. Adding additional memory on the OSS will improve the performance of reading smaller, frequently-accessed files.</para>
627         <para>For a failover configuration, the minimum RAM would be at least 6 GB. For 4 OSTs on each OSS in a failover configuration 10GB of RAM is reasonable. When the OSS is not handling any failed-over OSTs the extra RAM will be used as a read cache.</para>
628         <para>As a reasonable rule of thumb, about 2 GB of base memory plus 1 GB per OST can be used. In failover configurations, about 2 GB per OST is needed.</para>
629       </section>
630     </section>
631   </section>
632   <section xml:id="dbdoclet.50438256_78272">
633     <title><indexterm>
634         <primary>setup</primary>
635         <secondary>network</secondary>
636       </indexterm>Implementing Networks To Be Used by the Lustre File System</title>
637     <para>As a high performance file system, the Lustre file system places heavy loads on networks.
638       Thus, a network interface in each Lustre server and client is commonly dedicated to Lustre
639       file system traffic. This is often a dedicated TCP/IP subnet, although other network hardware
640       can also be used.</para>
641     <para>A typical Lustre file system implementation may include the following:</para>
642     <itemizedlist>
643       <listitem>
644         <para>A high-performance backend network for the Lustre servers, typically an InfiniBand (IB) network.</para>
645       </listitem>
646       <listitem>
647         <para>A larger client network.</para>
648       </listitem>
649       <listitem>
650         <para>Lustre routers to connect the two networks.</para>
651       </listitem>
652     </itemizedlist>
653     <para>Lustre networks and routing are configured and managed by specifying parameters to the
654       Lustre networking (<literal>lnet</literal>) module in
655         <literal>/etc/modprobe.d/lustre.conf</literal>.</para>
656     <para>To prepare to configure Lustre networking, complete the following steps:</para>
657     <orderedlist>
658       <listitem>
659         <para><emphasis role="bold">Identify all machines that will be running Lustre software and
660             the network interfaces they will use to run Lustre file system traffic. These machines
661             will form the Lustre network .</emphasis></para>
662         <para>A network is a group of nodes that communicate directly with one another. The Lustre
663           software includes Lustre network drivers (LNDs) to support a variety of network types and
664           hardware (see <xref linkend="understandinglustrenetworking"/> for a complete list). The
665           standard rules for specifying networks applies to Lustre networks. For example, two TCP
666           networks on two different subnets (<literal>tcp0</literal> and <literal>tcp1</literal>)
667           are considered to be two different Lustre networks.</para>
668       </listitem>
669       <listitem>
670         <para><emphasis role="bold">If routing is needed, identify the nodes to be used to route traffic between networks.</emphasis></para>
671         <para>If you are using multiple network types, then you will need a router. Any node with
672           appropriate interfaces can route Lustre networking (LNET) traffic between different
673           network hardware types or topologies --the node may be a server, a client, or a standalone
674           router. LNET can route messages between different network types (such as
675           TCP-to-InfiniBand) or across different topologies (such as bridging two InfiniBand or
676           TCP/IP networks). Routing will be configured in <xref linkend="configuringlnet"/>.</para>
677       </listitem>
678       <listitem>
679         <para><emphasis role="bold">Identify the network interfaces to include in or exclude from LNET. </emphasis>
680     </para>
681         <para>If not explicitly specified, LNET uses either the first available interface or a pre-defined default for a given network type. Interfaces that LNET should not use (such as an administrative network or IP-over-IB), can be excluded.</para>
682         <para>Network interfaces to be used or excluded will be specified using the lnet kernel module parameters networks and <literal>ip2netsas</literal> described in <xref linkend="configuringlnet"/>.</para>
683       </listitem>
684       <listitem>
685         <para><emphasis role="bold">To ease the setup of networks with complex network configurations, determine a cluster-wide module configuration.</emphasis></para>
686         <para>For large clusters, you can configure the networking setup for all nodes by using a single, unified set of parameters in the <literal>lustre.conf</literal> file on each node. Cluster-wide configuration is described in <xref linkend="configuringlnet"/>.</para>
687       </listitem>
688     </orderedlist>
689     <note>
690       <para>We recommend that you use &apos;dotted-quad&apos; notation for IP addresses rather than host names to make it easier to read debug logs and debug configurations with multiple interfaces.</para>
691     </note>
692   </section>
693 </chapter>