Whamcloud - gitweb
LUDOC-173 trademarks: Completed second pass of Intel trademark compliance review.
[doc/manual.git] / ManagingFileSystemIO.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="managingfilesystemio">
3   <title xml:id="managingfilesystemio.title">Managing the File System and I/O</title>
4   <para>This chapter describes file striping and I/O options, and includes the following sections:</para>
5   <itemizedlist>
6     <listitem>
7       <para><xref linkend="dbdoclet.50438211_17536"/></para>
8     </listitem>
9     <listitem>
10       <para><xref linkend="dbdoclet.50438211_75549"/></para>
11     </listitem>
12     <listitem>
13       <para><xref linkend="dbdoclet.50438211_11204"/></para>
14     </listitem>
15     <listitem>
16       <para><xref linkend="dbdoclet.50438211_80295"/></para>
17     </listitem>
18     <listitem>
19       <para><xref linkend="dbdoclet.50438211_61024"/></para>
20     </listitem>
21   </itemizedlist>
22   <section xml:id="dbdoclet.50438211_17536">
23       <title><indexterm><primary>I/O</primary></indexterm>
24           <indexterm><primary>I/O</primary><secondary>full OSTs</secondary></indexterm>
25           Handling Full OSTs</title>
26     <para>Sometimes a Lustre file system becomes unbalanced, often due to incorrectly-specified stripe settings, or when very large files are created that are not striped over all of the OSTs. If an OST is full and an attempt is made to write more information to the file system, an error occurs. The procedures below describe how to handle a full OST.</para>
27     <para>The MDS will normally handle space balancing automatically at file creation time, and this procedure is normally not needed, but may be desirable in certain circumstances (e.g. when creating very large files that would consume more than the total free space of the full OSTs).</para>
28     <section remap="h3">
29       <title><indexterm><primary>I/O</primary><secondary>OST space usage</secondary></indexterm>Checking OST Space Usage</title>
30       <para>The example below shows an unbalanced file system:</para>
31       <screen>client# lfs df -h
32 UUID                       bytes           Used            Available       \
33 Use%            Mounted on
34 lustre-MDT0000_UUID        4.4G            214.5M          3.9G            \
35 4%              /mnt/lustre[MDT:0]
36 lustre-OST0000_UUID        2.0G            751.3M          1.1G            \
37 37%             /mnt/lustre[OST:0]
38 lustre-OST0001_UUID        2.0G            755.3M          1.1G            \
39 37%             /mnt/lustre[OST:1]
40 lustre-OST0002_UUID        2.0G            1.7G            155.1M          \
41 86%             /mnt/lustre[OST:2] &lt;-
42 lustre-OST0003_UUID        2.0G            751.3M          1.1G            \
43 37%             /mnt/lustre[OST:3]
44 lustre-OST0004_UUID        2.0G            747.3M          1.1G            \
45 37%             /mnt/lustre[OST:4]
46 lustre-OST0005_UUID        2.0G            743.3M          1.1G            \
47 36%             /mnt/lustre[OST:5]
48  
49 filesystem summary:        11.8G           5.4G            5.8G            \
50 45%             /mnt/lustre</screen>
51       <para>In this case, OST:2 is almost full and when an attempt is made to write additional information to the file system (even with uniform striping over all the OSTs), the write command fails as follows:</para>
52       <screen>client# lfs setstripe /mnt/lustre 4M 0 -1
53 client# dd if=/dev/zero of=/mnt/lustre/test_3 bs=10M count=100
54 dd: writing &apos;/mnt/lustre/test_3&apos;: No space left on device
55 98+0 records in
56 97+0 records out
57 1017192448 bytes (1.0 GB) copied, 23.2411 seconds, 43.8 MB/s</screen>
58     </section>
59     <section remap="h3">
60       <title><indexterm><primary>I/O</primary><secondary>taking OST offline</secondary></indexterm>Taking a Full OST Offline</title>
61       <para>To avoid running out of space in the file system, if the OST usage is imbalanced and one or more OSTs are close to being full while there are others that have a lot of space, the full OSTs may optionally be deactivated at the MDS to prevent the MDS from allocating new objects there.</para>
62       <orderedlist>
63         <listitem>
64           <para>Log into the MDS server:</para>
65           <screen>client# ssh root@192.168.0.10 
66 root@192.168.0.10&apos;s password: 
67 Last login: Wed Nov 26 13:35:12 2008 from 192.168.0.6</screen>
68         </listitem>
69         <listitem>
70           <para>Use the <literal>lctl dl</literal> command to show the status of all file system components:</para>
71           <screen>mds# lctl dl 
72 0 UP mgs MGS MGS 9 
73 1 UP mgc MGC192.168.0.10@tcp e384bb0e-680b-ce25-7bc9-81655dd1e813 5
74 2 UP mdt MDS MDS_uuid 3
75 3 UP lov lustre-mdtlov lustre-mdtlov_UUID 4
76 4 UP mds lustre-MDT0000 lustre-MDT0000_UUID 5
77 5 UP osc lustre-OST0000-osc lustre-mdtlov_UUID 5
78 6 UP osc lustre-OST0001-osc lustre-mdtlov_UUID 5
79 7 UP osc lustre-OST0002-osc lustre-mdtlov_UUID 5
80 8 UP osc lustre-OST0003-osc lustre-mdtlov_UUID 5
81 9 UP osc lustre-OST0004-osc lustre-mdtlov_UUID 5
82 10 UP osc lustre-OST0005-osc lustre-mdtlov_UUID 5</screen>
83         </listitem>
84         <listitem>
85           <para>Use <literal>lctl</literal> deactivate to take the full OST offline:</para>
86           <screen>mds# lctl --device 7 deactivate</screen>
87         </listitem>
88         <listitem>
89           <para>Display the status of the file system components:</para>
90           <screen>mds# lctl dl 
91 0 UP mgs MGS MGS 9
92 1 UP mgc MGC192.168.0.10@tcp e384bb0e-680b-ce25-7bc9-81655dd1e813 5
93 2 UP mdt MDS MDS_uuid 3
94 3 UP lov lustre-mdtlov lustre-mdtlov_UUID 4
95 4 UP mds lustre-MDT0000 lustre-MDT0000_UUID 5
96 5 UP osc lustre-OST0000-osc lustre-mdtlov_UUID 5
97 6 UP osc lustre-OST0001-osc lustre-mdtlov_UUID 5
98 7 IN osc lustre-OST0002-osc lustre-mdtlov_UUID 5
99 8 UP osc lustre-OST0003-osc lustre-mdtlov_UUID 5
100 9 UP osc lustre-OST0004-osc lustre-mdtlov_UUID 5
101 10 UP osc lustre-OST0005-osc lustre-mdtlov_UUID 5</screen>
102         </listitem>
103       </orderedlist>
104       <para>The device list shows that OST0002 is now inactive. When new files are created in the file system, they will only use the remaining active OSTs. Either manual space rebalancing can be done by migrating data to other OSTs, as shown in the next section, or normal file deletion and creation can be allowed to passively rebalance the space usage.</para>
105     </section>
106     <section remap="h3">
107         <title>
108             <indexterm><primary>I/O</primary><secondary>migrating data</secondary></indexterm>
109             <indexterm><primary>maintenance</primary><secondary>full OSTs</secondary></indexterm>
110             Migrating Data within a File System</title>
111       <para>As stripes cannot be moved within the file system, data must be migrated manually by copying and renaming the file, removing the original file, and renaming the new file with the original file name. The simplest way to do this is to use the <literal>lfs_migrate</literal> command (see <xref linkend="dbdoclet.50438206_42260"/>). However, the steps for migrating a file by hand are also shown here for reference.</para>
112       <orderedlist>
113         <listitem>
114           <para>Identify the file(s) to be moved.</para>
115           <para>In the example below, output from the <literal>getstripe</literal> command indicates that the file <literal>test_2</literal> is located entirely on OST2:</para>
116           <screen>client# lfs getstripe /mnt/lustre/test_2
117 /mnt/lustre/test_2
118 obdidx     objid   objid   group
119      2      8     0x8       0</screen>
120         </listitem>
121         <listitem>
122           <para>To move single object(s), create a new copy and remove the original. Enter:</para>
123           <screen>client# cp -a /mnt/lustre/test_2 /mnt/lustre/test_2.tmp
124 client# mv /mnt/lustre/test_2.tmp /mnt/lustre/test_2</screen>
125         </listitem>
126         <listitem>
127           <para>To migrate large files from one or more OSTs, enter:</para>
128           <screen>client# lfs find --ost <replaceable>ost_name</replaceable> -size +1G | lfs_migrate -y</screen>
129         </listitem>
130         <listitem>
131           <para>Check the file system balance.</para>
132           <para>The <literal>df</literal> output in the example below shows a more balanced system compared to the <literal>df</literal> output in the example in <xref linkend="dbdoclet.50438211_17536"/>.</para>
133           <screen>client# lfs df -h
134 UUID                 bytes         Used            Available       Use%    \
135         Mounted on
136 lustre-MDT0000_UUID   4.4G         214.5M          3.9G            4%      \
137         /mnt/lustre[MDT:0]
138 lustre-OST0000_UUID   2.0G         1.3G            598.1M          65%     \
139         /mnt/lustre[OST:0]
140 lustre-OST0001_UUID   2.0G         1.3G            594.1M          65%     \
141         /mnt/lustre[OST:1]
142 lustre-OST0002_UUID   2.0G         913.4M          1000.0M         45%     \
143         /mnt/lustre[OST:2]
144 lustre-OST0003_UUID   2.0G         1.3G            602.1M          65%     \
145         /mnt/lustre[OST:3]
146 lustre-OST0004_UUID   2.0G         1.3G            606.1M          64%     \
147         /mnt/lustre[OST:4]
148 lustre-OST0005_UUID   2.0G         1.3G            610.1M          64%     \
149         /mnt/lustre[OST:5]
150  
151 filesystem summary:  11.8G 7.3G            3.9G    61%                     \
152 /mnt/lustre</screen>
153         </listitem>
154       </orderedlist>
155     </section>
156     <section remap="h3">
157         <title>
158             <indexterm><primary>I/O</primary><secondary>bringing OST online</secondary></indexterm>
159             <indexterm><primary>maintenance</primary><secondary>bringing OST online</secondary></indexterm>
160             
161             Returning an Inactive OST Back Online</title>
162       <para>Once the deactivated OST(s) no longer are severely imbalanced, due to either active or passive data redistribution, they should be reactivated so they will again have new files allocated on them.</para>
163       <screen>[mds]# lctl --device 7 activate
164 [mds]# lctl dl
165   0 UP mgs MGS MGS 9
166   1 UP mgc MGC192.168.0.10@tcp e384bb0e-680b-ce25-7bc9-816dd1e813 5
167   2 UP mdt MDS MDS_uuid 3
168   3 UP lov lustre-mdtlov lustre-mdtlov_UUID 4
169   4 UP mds lustre-MDT0000 lustre-MDT0000_UUID 5
170   5 UP osc lustre-OST0000-osc lustre-mdtlov_UUID 5
171   6 UP osc lustre-OST0001-osc lustre-mdtlov_UUID 5
172   7 UP osc lustre-OST0002-osc lustre-mdtlov_UUID 5
173   8 UP osc lustre-OST0003-osc lustre-mdtlov_UUID 5
174   9 UP osc lustre-OST0004-osc lustre-mdtlov_UUID 5
175  10 UP osc lustre-OST0005-osc lustre-mdtlov_UUID
176 </screen>
177     </section>
178   </section>
179   <section xml:id="dbdoclet.50438211_75549">
180       <title>
181             <indexterm><primary>I/O</primary><secondary>pools</secondary></indexterm>
182             <indexterm><primary>maintenance</primary><secondary>pools</secondary></indexterm>
183             <indexterm><primary>pools</primary></indexterm>
184           Creating and Managing OST Pools</title>
185     <para>The OST pools feature enables users to group OSTs together to make object placement more flexible. A &apos;pool&apos; is the name associated with an arbitrary subset of OSTs in a Lustre cluster.</para>
186     <para>OST pools follow these rules:</para>
187     <itemizedlist>
188       <listitem>
189         <para>An OST can be a member of multiple pools.</para>
190       </listitem>
191       <listitem>
192         <para>No ordering of OSTs in a pool is defined or implied.</para>
193       </listitem>
194       <listitem>
195         <para>Stripe allocation within a pool follows the same rules as the normal stripe allocator.</para>
196       </listitem>
197       <listitem>
198         <para>OST membership in a pool is flexible, and can change over time.</para>
199       </listitem>
200     </itemizedlist>
201     <para>When an OST pool is defined, it can be used to allocate files. When file or directory striping is set to a pool, only OSTs in the pool are candidates for striping. If a stripe_index is specified which refers to an OST that is not a member of the pool, an error is returned.</para>
202     <para>OST pools are used only at file creation. If the definition of a pool changes (an OST is added or removed or the pool is destroyed), already-created files are not affected.</para>
203     <note>
204       <para>An error (<literal>EINVAL</literal>) results if you create a file using an empty pool.</para>
205     </note>
206     <note>
207       <para>If a directory has pool striping set and the pool is subsequently removed, the new files created in this directory have the (non-pool) default striping pattern for that directory applied and no error is returned.</para>
208     </note>
209     <section remap="h3">
210       <title>Working with OST Pools</title>
211       <para>OST pools are defined in the configuration log on the MGS. Use the lctl command to:</para>
212       <itemizedlist>
213         <listitem>
214           <para>Create/destroy a pool</para>
215         </listitem>
216         <listitem>
217           <para>Add/remove OSTs in a pool</para>
218         </listitem>
219         <listitem>
220           <para>List pools and OSTs in a specific pool</para>
221         </listitem>
222       </itemizedlist>
223       <para>The lctl command MUST be run on the MGS. Another requirement for managing OST pools is to either have the MDT and MGS on the same node or have a Lustre client mounted on the MGS node, if it is separate from the MDS. This is needed to validate the pool commands being run are correct.</para>
224       <caution>
225         <para>Running the <literal>writeconf</literal> command on the MDS erases all pools information (as well as any other parameters set using <literal>lctl conf_param</literal>). We recommend that the pools definitions (and <literal>conf_param</literal> settings) be executed using a script, so they can be reproduced easily after a <literal>writeconf</literal> is performed.</para>
226       </caution>
227       <para>To create a new pool, run:</para>
228       <screen>mgs# lctl pool_new <replaceable>fsname</replaceable>.<replaceable>poolname</replaceable></screen>
229       <note>
230         <para>The pool name is an ASCII string up to 16 characters.</para>
231       </note>
232       <para>To add the named OST to a pool, run:</para>
233       <screen>mgs# lctl pool_add <replaceable>fsname</replaceable>.<replaceable>poolname</replaceable> <replaceable>ost_list</replaceable></screen>
234       <para>Where:</para>
235       <itemizedlist>
236         <listitem>
237           <para><literal><replaceable>ost_list</replaceable> is <replaceable>fsname</replaceable>-OST<replaceable>index_range</replaceable></literal></para>
238         </listitem>
239         <listitem>
240           <para><literal><replaceable>index_range</replaceable> is <replaceable>ost_index_start</replaceable>-<replaceable>ost_index_end[,index_range]</replaceable></literal> or <literal><replaceable>ost_index_start</replaceable>-<replaceable>ost_index_end/step</replaceable></literal></para>
241         </listitem>
242       </itemizedlist>
243       <para>If the leading <literal><replaceable>fsname</replaceable></literal> and/or ending <literal>_UUID</literal> are missing, they are automatically added.</para>
244       <para> For example, to add even-numbered OSTs to <literal>pool1</literal> on file system
245           <literal>lustre</literal>, run a single command (<literal>pool_add</literal>) to add many
246         OSTs to the pool at one time:</para>
247       <para><screen>lctl pool_add lustre.pool1 OST[0-10/2]</screen></para>
248       <note>
249         <para>Each time an OST is added to a pool, a new <literal>llog</literal> configuration record is created. For convenience, you can run a single command.</para>
250       </note>
251       <para>To remove a named OST from a pool, run:</para>
252       <screen>mgs# lctl pool_remove <replaceable>fsname</replaceable>.<replaceable>poolname</replaceable> <replaceable>ost_list</replaceable></screen>
253       <para>To destroy a pool, run:</para>
254       <screen>mgs# lctl pool_destroy <replaceable>fsname</replaceable>.<replaceable>poolname</replaceable></screen>
255       <note>
256         <para>All OSTs must be removed from a pool before it can be destroyed.</para>
257       </note>
258       <para>To list pools in the named file system, run:</para>
259       <screen>mgs# lctl pool_list <replaceable>fsname|pathname</replaceable></screen>
260       <para>To list OSTs in a named pool, run:</para>
261       <screen>lctl pool_list <replaceable>fsname</replaceable>.<replaceable>poolname</replaceable></screen>
262       <section remap="h4">
263         <title>Using the lfs Command with OST Pools</title>
264         <para>Several lfs commands can be run with OST pools. Use the <literal>lfs setstripe</literal> command to associate a directory with an OST pool. This causes all new regular files and directories in the directory to be created in the pool. The lfs command can be used to list pools in a file system and OSTs in a named pool.</para>
265         <para>To associate a directory with a pool, so all new files and directories will be created in the pool, run:</para>
266         <screen>client# lfs setstripe --pool|-p pool_name <replaceable>filename|dirname</replaceable> </screen>
267         <para>To set striping patterns, run:</para>
268         <screen>client# lfs setstripe [--size|-s stripe_size] [--offset|-o start_ost]
269            [--count|-c stripe_count] [--pool|-p pool_name]
270            <replaceable>dir|filename</replaceable></screen>
271         <note>
272           <para>If you specify striping with an invalid pool name, because the pool does not exist or the pool name was mistyped, <literal>lfs setstripe</literal> returns an error. Run <literal>lfs pool_list</literal> to make sure the pool exists and the pool name is entered correctly.</para>
273         </note>
274         <note>
275           <para>The <literal>--pool</literal> option for lfs setstripe is compatible with other modifiers. For example, you can set striping on a directory to use an explicit starting index.</para>
276         </note>
277       </section>
278     </section>
279     <section remap="h3">
280       <title><indexterm><primary>pools</primary><secondary>usage tips</secondary></indexterm>Tips for Using OST Pools</title>
281       <para>Here are several suggestions for using OST pools.</para>
282       <itemizedlist>
283         <listitem>
284           <para>A directory or file can be given an extended attribute (EA), that restricts striping to a pool.</para>
285         </listitem>
286         <listitem>
287           <para>Pools can be used to group OSTs with the same technology or performance (slower or faster), or that are preferred for certain jobs. Examples are SATA OSTs versus SAS OSTs or remote OSTs versus local OSTs.</para>
288         </listitem>
289         <listitem>
290           <para>A file created in an OST pool tracks the pool by keeping the pool name in the file LOV EA.</para>
291         </listitem>
292       </itemizedlist>
293     </section>
294   </section>
295   <section xml:id="dbdoclet.50438211_11204">
296     <title><indexterm><primary>I/O</primary><secondary>adding an OST</secondary></indexterm>Adding an OST to a Lustre File System</title>
297     <para>To add an OST to existing Lustre file system:</para>
298     <orderedlist>
299       <listitem>
300         <para>Add a new OST by passing on the following commands, run:</para>
301         <screen>oss# mkfs.lustre --fsname=spfs --mgsnode=mds16@tcp0 --ost --index=12 /dev/sda
302 oss# mkdir -p /mnt/test/ost12
303 oss# mount -t lustre /dev/sda /mnt/test/ost12</screen>
304       </listitem>
305       <listitem>
306         <para>Migrate the data (possibly).</para>
307         <para>The file system is quite unbalanced when new empty OSTs are added. New file creations are automatically balanced. If this is a scratch file system or files are pruned at a regular interval, then no further work may be needed. Files existing prior to the expansion can be rebalanced with an in-place copy, which can be done with a simple script.</para>
308         <para>The basic method is to copy existing files to a temporary file, then move the temp file over the old one. This should not be attempted with files which are currently being written to by users or applications. This operation redistributes the stripes over the entire set of OSTs.</para>
309         <para>A very clever migration script would do the following:</para>
310         <itemizedlist>
311           <listitem>
312             <para> Examine the current distribution of data.</para>
313           </listitem>
314           <listitem>
315             <para> Calculate how much data should move from each full OST to the empty ones.</para>
316           </listitem>
317           <listitem>
318             <para> Search for files on a given full OST (using <literal>lfs getstripe</literal>).</para>
319           </listitem>
320           <listitem>
321             <para> Force the new destination OST (using <literal>lfs setstripe</literal>).</para>
322           </listitem>
323           <listitem>
324             <para> Copy only enough files to address the imbalance.</para>
325           </listitem>
326         </itemizedlist>
327       </listitem>
328     </orderedlist>
329     <para>If a Lustre file system administrator wants to explore this approach further, per-OST
330       disk-usage statistics can be found under
331       <literal>/proc/fs/lustre/osc/*/rpc_stats</literal></para>
332   </section>
333   <section xml:id="dbdoclet.50438211_80295">
334     <title><indexterm><primary>I/O</primary><secondary>direct</secondary></indexterm>Performing Direct I/O</title>
335     <para>The Lustre software supports the <literal>O_DIRECT</literal> flag to open.</para>
336     <para>Applications using the <literal>read()</literal> and <literal>write()</literal> calls must supply buffers aligned on a page boundary (usually 4 K). If the alignment is not correct, the call returns <literal>-EINVAL</literal>. Direct I/O may help performance in cases where the client is doing a large amount of I/O and is CPU-bound (CPU utilization 100%).</para>
337     <section remap="h3">
338       <title>Making File System Objects Immutable</title>
339       <para>An immutable file or directory is one that cannot be modified, renamed or removed. To do this:</para>
340       <screen>chattr +i <replaceable>file</replaceable></screen>
341       <para>To remove this flag, use <literal>chattr -i</literal></para>
342     </section>
343   </section>
344   <section xml:id="dbdoclet.50438211_61024">
345     <title>Other I/O Options</title>
346     <para>This section describes other I/O options, including checksums, and the ptlrpcd thread pool.</para>
347     <section remap="h3">
348       <title>Lustre Checksums</title>
349       <para>To guard against network data corruption, a Lustre client can perform two types of data checksums: in-memory (for data in client memory) and wire (for data sent over the network). For each checksum type, a 32-bit checksum of the data read or written on both the client and server is computed, to ensure that the data has not been corrupted in transit over the network. The <literal>ldiskfs</literal> backing file system does NOT do any persistent checksumming, so it does not detect corruption of data in the OST file system.</para>
350       <para>The checksumming feature is enabled, by default, on individual client nodes. If the client or OST detects a checksum mismatch, then an error is logged in the syslog of the form:</para>
351       <screen>LustreError: BAD WRITE CHECKSUM: changed in transit before arrival at OST: \
352 from 192.168.1.1@tcp inum 8991479/2386814769 object 1127239/0 extent [10240\
353 0-106495]</screen>
354       <para>If this happens, the client will re-read or re-write the affected data up to five times to get a good copy of the data over the network. If it is still not possible, then an I/O error is returned to the application.</para>
355       <para>To enable both types of checksums (in-memory and wire), run:</para>
356       <screen>lctl set_param llite.*.checksum_pages=1</screen>
357       <para>To disable both types of checksums (in-memory and wire), run:</para>
358       <screen>lctl set_param llite.*.checksum_pages=0</screen>
359       <para>To check the status of a wire checksum, run:</para>
360       <screen>lctl get_param osc.*.checksums</screen>
361       <section remap="h4">
362         <title>Changing Checksum Algorithms</title>
363         <para>By default, the Lustre software uses the adler32 checksum algorithm, because it is
364           robust and has a lower impact on performance than crc32. The Lustre file system
365           administrator can change the checksum algorithm via <literal>lctl get_param</literal>,
366           depending on what is supported in the kernel.</para>
367         <para>To check which checksum algorithm is being used by the Lustre software, run:</para>
368         <screen>$ lctl get_param osc.*.checksum_type</screen>
369         <para>To change the wire checksum algorithm, run:</para>
370         <screen>$ lctl set_param osc.*.checksum_type=<replaceable>algorithm</replaceable></screen>
371         <note>
372           <para>The in-memory checksum always uses the adler32 algorithm, if available, and only falls back to crc32 if adler32 cannot be used.</para>
373         </note>
374         <para>In the following example, the <literal>lctl get_param</literal> command is used to
375           determine that the Lustre software is using the adler32 checksum algorithm. Then the
376             <literal>lctl set_param</literal> command is used to change the checksum algorithm to
377           crc32. A second <literal>lctl get_param</literal> command confirms that the crc32 checksum
378           algorithm is now in use.</para>
379         <screen>$ lctl get_param osc.*.checksum_type
380 osc.lustre-OST0000-osc-ffff81012b2c48e0.checksum_type=crc32 [adler]
381 $ lctl set_param osc.*.checksum_type=crc32
382 osc.lustre-OST0000-osc-ffff81012b2c48e0.checksum_type=crc32
383 $ lctl get_param osc.*.checksum_type
384 osc.lustre-OST0000-osc-ffff81012b2c48e0.checksum_type=[crc32] adler</screen>
385       </section>
386 </section>
387 <section remap="h3">
388 <title>Ptlrpc Thread Pool </title>
389 <para>Releases prior to Lustre software release 2.2 used two portal RPC daemons for each
390         client/server pair. One daemon handled all synchronous IO requests, and the second daemon
391         handled all asynchronous (non-IO) RPCs. The increasing use of large SMP nodes for Lustre
392         servers exposed some scaling issues. The lack of threads for large SMP nodes resulted in
393         cases where a single CPU would be 100% utilized and other CPUs would be relativity idle.
394         This is especially noticeable when a single client traverses a large directory. </para>
395 <para>Lustre software release 2.2.x implements a ptlrpc thread pool, so that multiple threads can be
396         created to serve asynchronous RPC requests. The number of threads spawned is controlled at
397         module load time using module options. By default one thread is spawned per CPU, with a
398         minimum of 2 threads spawned irrespective of module options. </para>
399 <para>One of the issues with thread operations is the cost of moving a thread context from one CPU to another with the resulting loss of CPU cache warmth. To reduce this cost, ptlrpc threads can be bound to a CPU. However, if the CPUs are busy, a bound thread may not be able to respond quickly, as the bound CPU may be busy with other tasks and the thread must wait to schedule. </para>
400       <para>Because of these considerations, the pool of ptlrpc threads can be a mixture of bound and unbound threads.   The system operator can balance the thread mixture based on system size and workload. </para>
401 <section>
402         <title>ptlrpcd parameters</title>
403         <para>These parameters should be set in <literal>/etc/modprobe.conf </literal>     or in the <literal> etc/modprobe.d</literal> directory, as options for the ptlrpc module. <screen>options ptlrpcd max_ptlrpcds=XXX
404 </screen></para>
405 <para>Sets the number of ptlrpcd threads created at module load time. The default if not specified is one thread per CPU, including hyper-threaded CPUs.  The lower bound is 2 (old prlrpcd behaviour)  <screen>options ptlrpcd ptlrpcd_bind_policy=[1-4]
406 </screen></para>
407 <para> Controls the binding of threads to CPUs. There are four policy options. </para>
408         <itemizedlist>
409        <listitem>
410         <para><literal role="bold">PDB_POLICY_NONE </literal>(ptlrpcd_bind_policy=1) All threads are unbound.</para>
411         </listitem>
412         <listitem>
413         <para><literal role="bold">PDB_POLICY_FULL </literal>(ptlrpcd_bind_policy=2) All threads attempt to bind to a CPU. </para>
414         </listitem>
415        <listitem>
416         <para><literal role="bold">PDB_POLICY_PAIR </literal>(ptlrpcd_bind_policy=3) This is the default policy. Threads are allocated as a bound/unbound pair. Each thread (bound or free) has a partner thread. The partnering is used by the ptlrpcd load policy, which determines how threads are allocated to CPUs. </para>
417         </listitem>
418        <listitem>
419         <para><literal role="bold">PDB_POLICY_NEIGHBOR </literal>(ptlrpcd_bind_policy=4) Threads are allocated as a bound/unbound pair. Each thread (bound or free) has two partner threads. </para>
420         </listitem>
421           </itemizedlist>
422
423 </section>
424 </section>
425   </section>
426 </chapter>