Whamcloud - gitweb
d14faf97595330d41d57a832d046d0848a35c078
[doc/manual.git] / SettingUpLustreSystem.xml
1 <?xml version='1.0' encoding='UTF-8'?>
2 <!-- This document was created with Syntext Serna Free. --><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   <info>
4     <title xml:id="settinguplustresystem.title">Setting Up a Lustre File System</title>
5   </info>
6   <para>This chapter describes hardware configuration requirements for a Lustre file system 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>5.1 Hardware Considerations</title>
36     <para>Lustre can work with any kind of block storage device such as single disks, software RAID, hardware RAID, or a logical volume manager. In contrast to some networked file systems, the block devices are only attached to the MDS and OSS nodes in Lustre and are not accessed by the clients directly.</para>
37     <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>
38     <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>
39     <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>
40     <para>Performance and other issues can occur when an MDS or OSS and a client are running on the same machine:</para>
41     <itemizedlist>
42       <listitem>
43         <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>
44       </listitem>
45       <listitem>
46         <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>
47       </listitem>
48     </itemizedlist>
49     <para>Only servers running on 64-bit CPUs are tested and supported. 64-bit CPU clients are typically used for testing to match expected customer usage and avoid limitations due to the 4 GB limit for RAM size, 1 GB low-memory limitation, and 16 TB file size limit of 32-bit CPUs. Also, due to kernel API limitations, performing backups of Lustre 2.x. filesystems on 32-bit clients may cause backup tools to confuse files that have the same 32-bit inode number.</para>
50     <para>The storage attached to the servers typically uses RAID to provide fault tolerance and can optionally be organized with logical volume management (LVM). It is then formatted by Lustre as a file system. Lustre OSS and MDS servers read, write and modify data in the format imposed by the file system.</para>
51     <para>Lustre uses journaling file system technology on both the MDTs and OSTs. For a MDT, as much as a 20 percent performance gain can be obtained by placing the journal on a separate device.</para>
52     <para>The MDS can effectively utilize a lot of CPU cycles. A minimium of four processor cores are recommended. More are advisable for files systems with many clients.</para>
53     <note>
54       <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). <anchor xml:id="dbdoclet.50438256_51943" xreflabel=""/></para>
55     </note>
56     <section remap="h3">
57       <title>5.1.1 MDT Storage Hardware Considerations</title>
58       <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>
59       <para>For maximum performance, the MDT should be configured as RAID1 with an internal journal and two disks from different controllers.</para>
60       <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>
61       <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>
62     </section>
63     <section remap="h3">
64       <title>5.1.2 OST Storage Hardware Considerations</title>
65       <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 16 terabytes (TBs) in size.</para>
66       <para>Lustre file system capacity is the sum of the capacities provided by the targets. For example, 64 OSSs, each with two 8 TB targets, provide a file system with a capacity of nearly 1 PB. If each OST uses ten 1 TB SATA disks (8 data disks plus 2 parity disks in a RAID 6 configuration), it may be possible to get 50 MB/sec from each drive, providing up to 400 MB/sec of disk bandwidth per OST. If this system is used as storage backend with a system network like InfiniBand that provides a similar bandwidth, then each OSS could provide 800 MB/sec of end-to-end I/O throughput. (Although the architectural constraints described here are simple, in practice it takes careful hardware selection, benchmarking and integration to obtain such results.)</para>
67     </section>
68   </section>
69   <section xml:id="dbdoclet.50438256_31079">
70     <title>5.2 Determining Space Requirements</title>
71     <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>
72     <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 lfssetstripe option. For more details, see <xref linkend="managingstripingfreespace"/>.</para>
73     <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>
74     <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>
75     <note>
76       <para>By default, the ldiskfs file system used by Lustre servers to store user-data objects and system data reserves 5% of space that cannot be used by Lustre. Additionally, Lustre reserves up to 400 MB on each OST for journal use and a small amount of space outside the journal to store accounting data for Lustre. This reserved space is unusable for general storage. Thus, at least 400 MB of space is used on each OST before any file object data is saved.<anchor xml:id="dbdoclet.50438256_74070" xreflabel=""/></para>
77     </note>
78     <section xml:id="dbdoclet.50438256_87676">
79       <title>5.2.1 Determining MDS/MDT Space Requirements</title>
80       <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 4 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>
81       <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>
82       <example>(100 TB * 1024 GB/TB * 1024 MB/GB) / 5 MB/inode = 20 million inodes</example>
83       <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>
84       <example>4 KB/inode * 40 million inodes = 160 GB</example>
85       <para>If the average file size is small, 4 KB for example, Lustre is not very efficient as the MDT uses as much space as the OSTs. However, this is not a common configuration for Lustre.</para>
86       <note>
87         <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>
88       </note>
89     </section>
90     <section remap="h3">
91       <title>5.2.2 Determining OSS/OST Space Requirements</title>
92       <para>For the OST, the amount of space taken by each object depends on the usage pattern of the users/applications running on the system. Lustre defaults to a conservative estimate for the object size (16 KB per object). If you are confident that the average file size for your applications will be larger than this, you can specify a larger average file size (fewer total inodes) to reduce file system overhead and minimize file system check time. See <xref linkend="dbdoclet.50438256_53886"/> for more details.</para>
93     </section>
94   </section>
95   <section xml:id="dbdoclet.50438256_84701">
96     <title>5.3 Setting File System Formatting Options</title>
97     <para>To override the default formatting options for any of the Lustre backing file systems, use this argument to <literal>mkfs.lustre</literal> to pass formatting options to the backing <literal>mkfs</literal>:</para>
98     <screen>--mkfsoptions=&apos;backing fs options&apos;</screen>
99     <para>For other options to format backing ldiskfs filesystems, see the Linux man page for <literal>mke2fs(8)</literal>.</para>
100     <section xml:id="dbdoclet.50438256_pgfId-1293228">
101       <title>5.3.1 Setting the Number of Inodes for the MDS</title>
102       <para>The number of inodes on the MDT is determined at format time based on the total size of the file system to be created. The default MDT inode ratio is one inode for every 4096 bytes of file system space. To override the inode ratio, use the following option:</para>
103       <screen>-i <emphasis>&lt;bytes per inode&gt;</emphasis></screen>
104       <para>For example, use the following option to create one inode per 2048 bytes of file system space.</para>
105       <screen>--mkfsoptions=&quot;-i 2048&quot; 
106 </screen>
107       <para>To avoid mke2fs creating an unusable file system, do not specify the -i option with an inode ratio below one inode per 1024 bytes. Instead, specify an absolute number of inodes, using this option:</para>
108       <screen>-N<emphasis> &lt;number of inodes&gt;</emphasis></screen>
109       <para>For example, by default, a 2 TB MDT will have 512M inodes. The largest currently-supported file system size is 16 TB, which would hold 4B inodes, the maximum possible number of inodes in a ldiskfs file system. With an MDS inode ratio of 1024 bytes per inode, a 2 TB MDT would hold 2B inodes, and a 4 TB MDT would hold 4B inodes.</para>
110     </section>
111     <section remap="h3">
112       <title>5.3.2 <anchor xml:id="dbdoclet.50438256_34593" xreflabel=""/>Setting the Inode Size for the <anchor xml:id="dbdoclet.50438256_marker-1293231" xreflabel=""/>MDT</title>
113       <para>Lustre uses &quot;large&quot; inodes on backing file systems to efficiently store Lustre metadata with each file. On the MDT, each inode is at least 512 bytes in size (by default), while on the OST each inode is 256 bytes in size.</para>
114       <para> The backing ldiskfs file system also needs sufficient space for other metadata like the journal (up to 400 MB), bitmaps and directories and a few files that Lustre uses to maintain cluster consistency.</para>
115       <para>To specify a larger inode size, use the <literal>-I &lt;inodesize&gt;</literal> option. We recommend you do NOT specify a smaller-than-default inode size, as this can lead to serious performance problems; and you cannot change this parameter after formatting the file system. The inode ratio must always be larger than the inode size.</para>
116     </section>
117     <section xml:id="dbdoclet.50438256_53886">
118       <title>5.3.3 Setting the Number of Inodes for an <anchor xml:id="dbdoclet.50438256_marker-1293235" xreflabel=""/>OST</title>
119       <para>When formatting OST file systems, it is normally advantageous to take local file system usage into account. Try to minimize the number of inodes on each OST, while keeping enough margin for potential variance in future usage. This helps reduce the format and file system check time, and makes more space available for data.</para>
120       <para> The current default is to create one inode per 16 KB of space in the OST file system, but in many environments, this is far too many inodes for the average file size. As a good rule of thumb, the OSTs should have at least:</para>
121       <screen>num_ost_inodes = 4 * <emphasis>&lt;num_mds_inodes&gt;</emphasis> * <emphasis>&lt;default_stripe_count&gt;</emphasis> / <emphasis>&lt;number_osts&gt;</emphasis></screen>
122       <para>You can specify the number of inodes on the OST file systems using the following option to the <literal>--mkfs</literal> option:</para>
123       <screen>-N <emphasis>&lt;num_inodes&gt;</emphasis></screen>
124       <para></para>
125       <para> Alternately, if you know the average file size, then you can specify the OST inode count for the OST file systems using:</para>
126       <screen>-i <emphasis>&lt;average_file_size</emphasis> / (<emphasis>number_of_stripes</emphasis> * 4)<emphasis>&gt;</emphasis></screen>
127       <para>For example, if the average file size is 16 MB and there are, by default 4 stripes per file, then <literal>--mkfsoptions=&apos;-i 1048576&apos;</literal> would be appropriate.</para>
128       <note>
129         <para>In addition to the number of inodes, file system check time on OSTs is affected by a number of other variables: size of the file system, number of allocated blocks, distribution of allocated blocks on the disk, disk speed, CPU speed, and amount of RAM on the server. Reasonable file system check times (without serious file system problems), are expected to take five and thirty minutes per TB.</para>
130       </note>
131       <para>For more details on formatting MDT and OST file systems, see <xref linkend="dbdoclet.50438208_51921"/>.</para>
132     </section>
133     <section remap="h3">
134       <title>5.3.4 File and File System Limits</title>
135       <para><xref linkend="settinguplustresystem.tab1"/> describes file and file system size limits. These limits are imposed by either the Lustre architecture or the Linux virtual file system (VFS) and virtual memory subsystems. In a few cases, a limit is defined within the code and can be changed by re-compiling Lustre (see <xref linkend="installinglustrefromsourcecode"/>). In these cases, the indicated limit was used for Lustre testing. </para>
136       <table frame="all">
137         <title xml:id="settinguplustresystem.tab1">File and file system limits</title>
138         <tgroup cols="3">
139           <colspec colname="c1" colwidth="3*"/>
140           <colspec colname="c2" colwidth="2*"/>
141           <colspec colname="c3" colwidth="4*"/>
142           <thead>
143             <row>
144               <entry>
145                 <para><emphasis role="bold">Limit</emphasis></para>
146               </entry>
147               <entry>
148                 <para><emphasis role="bold">Value</emphasis></para>
149               </entry>
150               <entry>
151                 <para><emphasis role="bold">Description</emphasis></para>
152               </entry>
153             </row>
154           </thead>
155           <tbody>
156             <row>
157               <entry>
158                 <para> Maximum <anchor xml:id="dbdoclet.50438256_marker-1290714" xreflabel=""/>stripe count</para>
159               </entry>
160               <entry>
161                 <para> 160</para>
162               </entry>
163               <entry>
164                 <para> This limit is hard-coded, but is near the upper limit imposed by the underlying ldiskfs file system.</para>
165               </entry>
166             </row>
167             <row>
168               <entry>
169                 <para> Maximum <anchor xml:id="dbdoclet.50438256_marker-1290722" xreflabel=""/>stripe size</para>
170               </entry>
171               <entry>
172                 <para> &lt; 4 GB</para>
173               </entry>
174               <entry>
175                 <para> The amount of data written to each object before moving on to next object.</para>
176               </entry>
177             </row>
178             <row>
179               <entry>
180                 <para> Minimum <anchor xml:id="dbdoclet.50438256_marker-1290730" xreflabel=""/>stripe size</para>
181               </entry>
182               <entry>
183                 <para> 64 KB</para>
184               </entry>
185               <entry>
186                 <para> Due to the 64 KB PAGE_SIZE on some 64-bit machines, the minimum stripe size is set to 64 KB.</para>
187               </entry>
188             </row>
189             <row>
190               <entry>
191                 <para> Maximum object size</para>
192               </entry>
193               <entry>
194                 <para> 2 TB</para>
195               </entry>
196               <entry>
197                 <para> The amount of data that can be stored in a single object. The ldiskfs limit of 2TB for a single file applies. Lustre allows 160 stripes of 2 TB each.</para>
198               </entry>
199             </row>
200             <row>
201               <entry>
202                 <para> Maximum <anchor xml:id="dbdoclet.50438256_marker-1290738" xreflabel=""/>number of OSTs</para>
203               </entry>
204               <entry>
205                 <para> 8150</para>
206               </entry>
207               <entry>
208                 <para> The maximum number of OSTs is a constant that can be changed at compile time. Lustre has been tested with up to 4000 OSTs.</para>
209               </entry>
210             </row>
211             <row>
212               <entry>
213                 <para> Maximum number of MDTs</para>
214               </entry>
215               <entry>
216                 <para> 1</para>
217               </entry>
218               <entry>
219                 <para> Maximum of 1 MDT per file system, but a single MDS can host multiple MDTs, each one for a separate file system.</para>
220               </entry>
221             </row>
222             <row>
223               <entry>
224                 <para> Maximum <anchor xml:id="dbdoclet.50438256_marker-1290746" xreflabel=""/>number of clients</para>
225               </entry>
226               <entry>
227                 <para> 131072</para>
228               </entry>
229               <entry>
230                 <para> The number of clients is a constant that can be changed at compile time.</para>
231               </entry>
232             </row>
233             <row>
234               <entry>
235                 <para> Maximum size of a <anchor xml:id="dbdoclet.50438256_marker-1290753" xreflabel=""/>file system</para>
236               </entry>
237               <entry>
238                 <para> 64 PB</para>
239               </entry>
240               <entry>
241                 <para> Each OST or MDT can have a file system up to 16 TB, regardless of whether 32-bit or 64-bit kernels are on the server.</para>
242                 <para>You can have multiple OST file systems on a single OSS node.</para>
243               </entry>
244             </row>
245             <row>
246               <entry>
247                 <para> Maximum <anchor xml:id="dbdoclet.50438256_marker-1290761" xreflabel=""/>file size</para>
248               </entry>
249               <entry>
250                 <para> 16 TB on 32-bit systems</para>
251                 <para>&#160;</para>
252                 <para>320 TB on 64-bit systems</para>
253               </entry>
254               <entry>
255                 <para> Individual files have a hard limit of nearly 16 TB on 32-bit systems imposed by the kernel memory subsystem. On 64-bit systems this limit does not exist. Hence, files can be 64-bits in size. Lustre imposes an additional size limit of up to the number of stripes, where each stripe is 2 TB.</para>
256                 <para>A single file can have a maximum of 160 stripes, which gives an upper single file limit of 320 TB 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>
257               </entry>
258             </row>
259             <row>
260               <entry>
261                 <para> Maximum number of <anchor xml:id="dbdoclet.50438256_marker-1290770" xreflabel=""/>files or subdirectories in a single directory</para>
262               </entry>
263               <entry>
264                 <para> 10 million files</para>
265               </entry>
266               <entry>
267                 <para> Lustre uses the ldiskfs hashed directory code, which has a limit of about 10 million files depending on the length of the file name. The limit on subdirectories is the same as the limit on regular files.</para>
268                 <para>Lustre is tested with ten million files in a single directory.</para>
269               </entry>
270             </row>
271             <row>
272               <entry>
273                 <para> Maximum number of files in the file system</para>
274               </entry>
275               <entry>
276                 <para> 4 billion</para>
277               </entry>
278               <entry>
279                 <para> The ldiskfs file system imposes an upper limit of 4 billion inodes. By default, the MDS file system is formatted with 4 KB of space per inode, meaning 512 million inodes per file system of 2 TB.</para>
280                 <para>This can be increased initially, at the time of MDS file system creation. For more information, see <xref linkend="settinguplustresystem"/>.</para>
281               </entry>
282             </row>
283             <row>
284               <entry>
285                 <para> Maximum length of a <anchor xml:id="dbdoclet.50438256_marker-1290791" xreflabel=""/>filename</para>
286               </entry>
287               <entry>
288                 <para> 255 bytes (filename)</para>
289               </entry>
290               <entry>
291                 <para> This limit is 255 bytes for a single filename, the same as in an ldiskfs file system.</para>
292               </entry>
293             </row>
294             <row>
295               <entry>
296                 <para> Maximum length of a <anchor xml:id="dbdoclet.50438256_marker-1292019" xreflabel=""/>pathname</para>
297               </entry>
298               <entry>
299                 <para> 4096 bytes (pathname)</para>
300               </entry>
301               <entry>
302                 <para> The Linux VFS imposes a full pathname length of 4096 bytes.</para>
303               </entry>
304             </row>
305             <row>
306               <entry>
307                 <para> Maximum number of <anchor xml:id="dbdoclet.50438256_marker-1290800" xreflabel=""/>open files for Lustre file systems</para>
308               </entry>
309               <entry>
310                 <para> None</para>
311               </entry>
312               <entry>
313                 <para> Lustre does not impose a maximum for the number of open files, but the practical limit depends on the amount of RAM on the MDS. No &quot;tables&quot; for open files exist on the MDS, as they are only linked in a list to a given client&apos;s export. Each client process probably has a limit of several thousands of open files which depends on the ulimit.</para>
314               </entry>
315             </row>
316           </tbody>
317         </tgroup>
318       </table>
319       <para>&#160;</para>
320     </section>
321   </section>
322   <section xml:id="dbdoclet.50438256_26456">
323     <title>5.4 Determining Memory<anchor xml:id="dbdoclet.50438256_marker-1292212" xreflabel=""/> Requirements</title>
324     <para>This section describes the memory requirements for each Lustre file system component.</para>
325     <section remap="h3">
326       <title>5.4.1 Client Memory Requirements</title>
327       <para>A minimum of 2 GB RAM is recommended for clients.</para>
328     </section>
329     <section remap="h3">
330       <title>5.4.2 <anchor xml:id="dbdoclet.50438256_78447" xreflabel=""/>MDS Memory Requirements</title>
331       <para>MDS memory requirements are determined by the following factors:</para>
332       <itemizedlist>
333         <listitem>
334           <para> Number of clients</para>
335         </listitem>
336         <listitem>
337           <para> Size of the directories</para>
338         </listitem>
339         <listitem>
340           <para> Load placed on server</para>
341         </listitem>
342       </itemizedlist>
343       <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>
344       <para>MDS memory requirements include:</para>
345       <itemizedlist>
346         <listitem>
347           <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>
348         </listitem>
349         <listitem>
350           <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>
351         </listitem>
352         <listitem>
353           <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>
354         </listitem>
355         <listitem>
356           <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>
357         </listitem>
358       </itemizedlist>
359       <section remap="h4">
360         <title>5.4.2.1 Calculating MDS Memory Requirements</title>
361         <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>
362         <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>
363         <example>
364           <para>Operating system overhead = 512 MB</para>
365           <para>File system journal = 400 MB</para>
366           <para>1000 * 4-core clients * 100 files/core * 2kB = 800 MB</para>
367           <para>16 interactive clients * 10,000 files * 2kB = 320 MB</para>
368           <para>1,600,000 file extra working set * 1.5kB/file = 2400 MB</para>
369         </example>
370         <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>
371         <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>
372       </section>
373     </section>
374     <section remap="h3">
375       <title>5.4.3 <anchor xml:id="dbdoclet.50438256_84553" xreflabel=""/>OSS Memory Requirements</title>
376       <para>When planning the hardware for an OSS node, consider the memory usage of several components in the Lustre system (i.e., journal, service threads, file system metadata, etc.). Also, consider the effect of the OSS read cache feature, which consumes memory as it caches data on the OSS node.</para>
377       <para>In addition to the MDS memory requirements mentioned in <xref linkend="dbdoclet.50438256_87676"/>, the OSS requirements include:</para>
378       <itemizedlist>
379         <listitem>
380           <para><emphasis role="bold">Service threads</emphasis> : The service threads on the OSS node pre-allocate a 1 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>
381         </listitem>
382         <listitem>
383           <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>
384         </listitem>
385       </itemizedlist>
386       <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>
387       <para>Because of these memory requirements, the following calculations should be taken as determining the absolute minimum RAM required in an OSS node.</para>
388       <section remap="h4">
389         <title>5.4.3.1 Calculating OSS Memory Requirements</title>
390         <para>The minimum recommended RAM size for an OSS with two OSTs is computed below:</para>
391         <example>
392           <para>Ethernet/TCP send/receive buffers (1 MB * 512 threads) = 512 MB</para>
393           <para>400 MB journal size * 2 OST devices = 800 MB</para>
394           <para>1.5 MB read/write per OST IO thread * 512 threads = 768 MB</para>
395           <para>600 MB file system read cache * 2 OSTs = 1200 MB</para>
396           <para>1000 * 4-core clients * 100 files/core * 2kB = 800MB</para>
397           <para>16 interactive clients * 10,000 files * 2kB = 320MB</para>
398           <para>1,600,000 file extra working set * 1.5kB/file = 2400MB</para>
399           <para>     DLM locks + filesystem metadata TOTAL = 3520MB</para>
400           <para>Per OSS DLM locks + filesystem metadata = 3520MB/6 OSS = 600MB (approx.)</para>
401           <para>Per OSS RAM minimum requirement = 4096MB (approx.)</para>
402         </example>
403         <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>
404         <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>
405         <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>
406       </section>
407     </section>
408   </section>
409   <section xml:id="dbdoclet.50438256_78272">
410     <title>5.5 Implementing Networks To Be Used by Lustre</title>
411     <para>As a high performance file system, Lustre places heavy loads on networks. Thus, a network interface in each Lustre server and client is commonly dedicated to Lustre traffic. This is often a dedicated TCP/IP subnet, although other network hardware can also be used.</para>
412     <para>A typical Lustre implementation may include the following:</para>
413     <itemizedlist>
414       <listitem>
415         <para> A high-performance backend network for the Lustre servers, typically an InfiniBand (IB) network.</para>
416       </listitem>
417       <listitem>
418         <para> A larger client network.</para>
419       </listitem>
420       <listitem>
421         <para> Lustre routers to connect the two networks.</para>
422       </listitem>
423     </itemizedlist>
424     <para>Lustre networks and routing are configured and managed by specifying parameters to the Lustre Networking (lnet) module in <literal>/etc/modprobe.conf</literal> or <literal>/etc/modprobe.conf.local</literal> (depending on your Linux distribution).</para>
425     <para>To prepare to configure Lustre Networking, complete the following steps:</para>
426     <orderedlist>
427       <listitem>
428         <para><emphasis role="bold">Identify all machines that will be running Lustre and the network interfaces they will use to run Lustre traffic. These machines will form the Lustre network.</emphasis></para>
429         <para>A network is a group of nodes that communicate directly with one another. Lustre includes Lustre network drivers (LNDs) to support a variety of network types and hardware (see <xref linkend="understandinglustrenetworking"/> for a complete list). The standard rules for specifying networks applies to Lustre networks. For example, two TCP networks on two different subnets (<literal>tcp0</literal> and <literal>tcp1</literal>) are considered to be two different Lustre networks.</para>
430       </listitem>
431       <listitem>
432         <para><emphasis role="bold">If routing is needed, identify the nodes to be used to route traffic between networks.</emphasis></para>
433         <para>If you are using multiple network types, then you&apos;ll need a router. Any node with appropriate interfaces can route Lustre Networking (LNET) traffic between different network hardware types or topologies --the node may be a server, a client, or a standalone router. LNET can route messages between different network types (such as TCP-to-InfiniBand) or across different topologies (such as bridging two InfiniBand or TCP/IP networks). Routing will be configured in <xref linkend="configuringlnet"/>.</para>
434       </listitem>
435       <listitem>
436         <emphasis role="bold">
437           <para>Identify the network interfaces to include in or exclude from LNET.</para>
438         </emphasis>
439         <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>
440         <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>
441       </listitem>
442       <listitem>
443         <para><emphasis role="bold">To ease the setup of networks with complex network configurations, determine a cluster-wide module configuration.</emphasis></para>
444         <para>For large clusters, you can configure the networking setup for all nodes by using a single, unified set of parameters in the modprobe.conf file on each node. Cluster-wide configuration is described in <xref linkend="configuringlnet"/>.</para>
445       </listitem>
446     </orderedlist>
447     <note>
448       <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>
449     </note>
450   </section>
451 </chapter>