1 <?xml version='1.0' encoding='UTF-8'?><chapter xmlns="http://docbook.org/ns/docbook" xmlns:xl="http://www.w3.org/1999/xlink" version="5.0" xml:lang="en-US" xml:id="dataonmdt"
3 <title xml:id="dataonmdt.title">Data on MDT (DoM)</title>
4 <para>This chapter describes Data on MDT (DoM).</para>
5 <section xml:id="dbdoclet.domintro">
11 <primary>dom</primary>
12 <secondary>intro</secondary>
13 </indexterm>Introduction to Data on MDT (DoM)</title>
14 <para>The Lustre Data on MDT (DoM) feature improves small file IO by
15 placing small files directly on the MDT, and also improves large file IO
16 by avoiding the OST being affected by small random IO that can cause
17 device seeking and hurt the streaming IO performance. Therefore, users
18 can expect more consistent performance for both small file IO and mixed IO
20 <para>The layout of a DoM file is stored on disk as a composite layout
21 and is a special case of Progressive File Layout (PFL). Please see
22 <xref linkend="pfl" /> for more information on PFL. For DoM files, the
23 file layout is composed of the component of the file, which is placed on
24 an MDT, and the rest of components are placed on OSTs, if needed. The
25 first component is placed on the MDT in the MDT object data blocks.
26 This component always has one stripe with size equal to the component
27 size. Such a component with an MDT layout can be only the first component
28 in composite layout. The rest of components are placed over OSTs as usual
29 with a RAID0 layout. The OST components are not instantiated until
30 a client writes or truncates the file beyond the size of the MDT
33 <section xml:id="dbdoclet.usercommands">
36 <primary>dom</primary>
39 <primary>dom</primary>
40 <secondary>usercommands</secondary>
41 </indexterm>User Commands</title>
42 <para>Lustre provides the <literal>lfs setstripe</literal> command for
43 users to create DoM files. Also, as usual,
44 <literal>lfs getstripe</literal> command can be used to list the
45 striping/component information for a given file, while
46 <literal>lfs find</literal> command can be used to search the directory
47 tree rooted at the given directory or file name for the files that match
48 the given DoM component parameters, e.g. layout type.</para>
49 <section xml:id="dbdoclet.lfssetstripe">
52 <primary>dom</primary>
53 <secondary>lfssetstripe</secondary>
54 </indexterm>lfs setstripe for DoM files</title>
55 <para>The <literal>lfs setstripe</literal> command is used to create
57 <section><title>Command</title>
59 lfs setstripe --component-end|-E end1 --layout|-L mdt \
60 [--component-end|-E end2 [STRIPE_OPTIONS] ...] <filename>
62 The command above creates a file with the special composite
63 layout, which defines the first component as an MDT component. The
64 MDT component must start from offset 0 and ends at
65 <replaceable>end1</replaceable>. The
66 <replaceable>end1</replaceable> is also the stripe size of this
67 component, and is limited by the
68 <literal>lod.*.dom_stripesize</literal> of the MDT the file is
69 created on. No other options are required for this component.
70 The rest of the components use the normal syntax for composite
73 <note><para>If the next component doesn't specify striping, such
75 <screen>lfs setstripe -E 1M -L mdt -E EOF <filename></screen>
76 Then that component get its settings from the default filesystem
77 striping.</para></note>
79 <section><title>Example</title>
80 <para>The command below creates a file with a DoM layout. The first
81 component has an <literal>mdt</literal> layout and is placed on the
82 MDT, covering [0, 1M). The second component covers [1M, EOF) and is
83 striped over all available OSTs.</para>
84 <para><screen>client$ lfs setstripe -E 1M -L mdt -E -1 -S 4M -c -1 \
85 /mnt/lustre/domfile</screen></para>
86 <para>The resulting layout is illustrated by
87 <xref xmlns:xlink="http://www.w3.org/1999/xlink"
88 linkend="dataonmdt.fig.layout1" />.</para>
89 <figure xml:id="dataonmdt.fig.layout1">
90 <title>Resulting file layout</title>
93 <imagedata scalefit="1" width="50%"
94 fileref="./figures/DoM_Layout1.png" />
97 <phrase>Resulting file layout</phrase>
101 <para>The resulting can also be checked with
102 <literal>lfs getstripe</literal> as shown below:</para>
103 <screen>client$ lfs getstripe /mnt/lustre/domfile
110 lcme_extent.e_start: 0
111 lcme_extent.e_end: 1048576
113 lmm_stripe_size: 1048576
121 lcme_extent.e_start: 1048576
122 lcme_extent.e_end: EOF
124 lmm_stripe_size: 4194304
126 lmm_layout_gen: 65535
127 lmm_stripe_offset: -1</screen>
128 <para>The output above shows that the first component has size 1MB and
129 pattern is 'mdt'. The second component is not instantiated yet, which
130 is seen by <literal>lcme_flags: 0</literal>.</para>
131 <para>If more than 1MB of data is written to the file, then
132 <literal>lfs getstripe</literal> output is changed accordingly:</para>
133 <screen>client$ lfs getstripe /mnt/lustre/domfile
140 lcme_extent.e_start: 0
141 lcme_extent.e_end: 1048576
143 lmm_stripe_size: 1048576
151 lcme_extent.e_start: 1048576
152 lcme_extent.e_end: EOF
154 lmm_stripe_size: 4194304
159 - 0: { l_ost_idx: 0, l_fid: [0x100000000:0x2:0x0] }
160 - 1: { l_ost_idx: 1, l_fid: [0x100010000:0x2:0x0] }</screen>
161 <para>The output above shows that the second component now has objects
162 on OSTs with a 4MB stripe.</para>
165 <section><title>Setting a default DoM layout to an existing directory
167 <para>A DoM layout can be set on an existing directory as well. When
168 set, all the files created after that will inherit this layout by
170 <section><title>Command</title>
171 <screen>lfs setstripe --component-end|-E end1 --layout|-L mdt \
172 [--component-end|-E end2 [STRIPE_OPTIONS] ...] <dirname></screen>
174 <section><title>Example</title>
175 <screen>client$ mkdir /mnt/lustre/domdir
176 client$ touch /mnt/lustre/domdir/normfile
177 client$ lfs setstripe -E 1M -L mdt -E -1 /mnt/lustre/domdir/
178 client$ lfs getstripe -d /mnt/lustre/domdir
184 lcme_extent.e_start: 0
185 lcme_extent.e_end: 1048576
186 stripe_count: 0 stripe_size: 1048576 \
187 pattern: mdt stripe_offset: -1
191 lcme_extent.e_start: 1048576
192 lcme_extent.e_end: EOF
193 stripe_count: 1 stripe_size: 1048576 \
194 pattern: raid0 stripe_offset: -1
196 <para>In the output above, it can be seen that the directory has
197 a default layout with a DoM component.</para>
198 <para>The following example will check layouts of files in that
200 <screen>client$ touch /mnt/lustre/domdir/domfile
201 client$ lfs getstripe /mnt/lustre/domdir/normfile
202 /mnt/lustre/domdir/normfile
204 lmm_stripe_size: 1048576
208 obdidx objid objid group
212 client$ lfs getstripe /mnt/lustre/domdir/domfile
213 /mnt/lustre/domdir/domfile
219 lcme_extent.e_start: 0
220 lcme_extent.e_end: 1048576
222 lmm_stripe_size: 1048576
230 lcme_extent.e_start: 1048576
231 lcme_extent.e_end: EOF
233 lmm_stripe_size: 1048576
235 lmm_layout_gen: 65535
236 lmm_stripe_offset: -1</screen>
237 <para>We can see that first file
238 <emphasis role="bold">normfile</emphasis> in that directory has an
239 ordinary layout, whereas the file <emphasis role="bold">domfile
240 </emphasis> inherits the directory default layout and is a DoM
242 <note><para>The directory default layout setting will be inherited
243 by new files even if the server DoM size limit will be set to a
244 lower value.</para></note>
247 <section xml:id="dbdoclet.domstripesize">
250 <primary>dom</primary>
253 <primary>dom</primary>
254 <secondary>domstripesize</secondary>
255 </indexterm>DoM Stripe Size Restrictions</title>
256 <para>The maximum size of a DoM component is restricted in several
257 ways to protect the MDT from being eventually filled with large files.
259 <section><title>LFS limits for DoM component size</title>
260 <para><literal>lfs setstripe</literal> allows for setting the
261 component size for MDT layouts up to 1GB (this is a compile-time
262 limit to avoid improper configuration), however, the size must
263 also be aligned by 64KB due to the minimum stripe size in Lustre
264 (see <xref linkend="settinguplustresystem.tab2"/>
265 <literal>Minimum stripe size</literal>). There is also a limit
266 imposed on each file by <literal>lfs setstripe -E end</literal>
267 that may be smaller than the MDT-imposed limit if this is better
268 for a particular usage.</para>
270 <section><title>MDT Server Limits</title>
271 <para>The <literal>lod.$fsname-MDTxxxx.dom_stripesize</literal>
272 is used to control the per-MDT maximum size for a DoM component.
273 Larger DoM components specified by the user will be truncated to
274 the MDT-specified limit, and as such may be different on each
275 MDT to balance DoM space usage on each MDT separately, if needed.
276 It is 1MB by default and can be changed with the
277 <literal>lctl</literal> tool. For more information on setting
278 <literal>dom_stripesize</literal> please see
279 <xref linkend="dbdoclet.dom_stripesize" />.</para>
282 <section xml:id="dbdoclet.domlfsgetstripe">
285 <primary>dom</primary>
288 <primary>dom</primary>
289 <secondary>lfsgetstripe</secondary>
290 </indexterm>lfs getstripe for DoM files</title>
291 <para>The <literal>lfs getstripe</literal> command is used to list
292 the striping/component information for a given file. For DoM files, it
293 can be used to check its layout and size.</para>
294 <section><title>Command</title>
295 <para><screen>lfs getstripe [--component-id|-I [comp_id]] [--layout|-L] \
296 [--stripe-size|-S] <dirname|filename></screen></para>
298 <section><title>Examples</title>
299 <screen>client$ lfs getstripe -I1 /mnt/lustre/domfile
306 lcme_extent.e_start: 0
307 lcme_extent.e_end: 1048576
309 lmm_stripe_size: 1048576
313 lmm_objects:</screen>
314 <para>Short info about the layout and size of DoM component can
315 be obtained with the use of the <literal>-L</literal> option
316 along with <literal>-S</literal> or <literal>-E</literal> options:
317 <screen>client$ lfs getstripe -I1 -L -S /mnt/lustre/domfile
318 lmm_stripe_size: 1048576
320 client$ lfs getstripe -I1 -L -E /mnt/lustre/domfile
321 lcme_extent.e_end: 1048576
322 lmm_pattern: mdt</screen>
323 Both commands return layout type and its size. The stripe size is
324 equal to the extent size of component in case of DoM files, so
325 both can be used to get size on the MDT.</para>
328 <section xml:id="dbdoclet.domlfsfind">
331 <primary>dom</primary>
334 <primary>dom</primary>
335 <secondary>lfsfind</secondary>
336 </indexterm>lfs find for DoM files</title>
337 <para>The <literal>lfs find</literal> command can be used to search
338 the directory tree rooted at the given directory or file name for the
339 files that match the given parameters. The command below shows the new
340 parameters for DoM files and their usages are similar to the
341 <literal>lfs getstripe</literal> command.</para>
342 <section><title>Command</title>
343 <para><screen>lfs find <directory|filename> [--layout|-L] [...]
346 <section><title>Examples</title>
347 <para>Find all files with DoM layout under directory
348 <literal>/mnt/lustre</literal>:
349 <screen>client$ lfs find -L mdt /mnt/lustre
352 /mnt/lustre/domdir/domfile
354 client$ lfs find -L mdt -type f /mnt/lustre
356 /mnt/lustre/domdir/domfile
358 client$ lfs find -L mdt -type d /mnt/lustre
359 /mnt/lustre/domdir</screen>
360 By using this command you can find all DoM objects, only DoM
361 files, or only directories with default DoM layout.</para>
362 <para>Find the DoM files/dirs with a particular stripe size:
363 <screen>client$ lfs find -L mdt -S -1200K -type f /mnt/lustre
365 /mnt/lustre/domdir/domfile
367 client$ lfs find -L mdt -S +200K -type f /mnt/lustre
369 /mnt/lustre/domdir/domfile</screen>
370 The first command finds all DoM files with stripe size less
371 than 1200KB. The second command above does the same for files
372 with a stripe size greater than 200KB. In both cases, all DoM
373 files are found because their DoM size is 1MB.</para>
376 <section xml:id="dbdoclet.dom_stripesize">
379 <primary>dom</primary>
382 <primary>dom</primary>
383 <secondary>dom_stripesize</secondary>
384 </indexterm>The dom_stripesize parameter</title>
385 <para>The MDT controls the default maximum DoM size on the server via
386 the parameter <literal>dom_stripesize</literal> in the LOD device.
387 The <literal>dom_stripesize</literal> can be set differently for each
388 MDT, if necessary. The default value of the parameter is 1MB and can
389 be changed with <literal>lctl</literal> tool.</para>
390 <section><title>Get Command</title>
391 <para><screen>lctl get_param lod.*MDT<index>*.dom_stripesize
394 <section><title>Get Examples</title>
395 <para>The commands below get the maximum allowed DoM size on the
396 server. The final command is an attempt to create a file with a
397 larger size than the parameter setting and correctly fails.
398 <screen>mds# lctl get_param lod.*MDT0000*.dom_stripesize
399 lod.lustre-MDT0000-mdtlov.dom_stripesize=1048576
401 mds# lctl get_param -n lod.*MDT0000*.dom_stripesize
404 client$ lfs setstripe -E 2M -L mdt /mnt/lustre/dom2mb
405 Create composite file /mnt/lustre/dom2mb failed. Invalid argument
406 error: setstripe: create composite file '/mnt/lustre/dom2mb' failed:
407 Invalid argument</screen></para>
409 <section><title>Temporary Set Command</title>
410 <para>To temporarily set the value of the parameter, the
411 <literal>lctl set_param</literal> is used:
412 <screen>lctl set_param lod.*MDT<index>*.dom_stripesize=<value>
415 <section><title>Temporary Set Examples</title>
416 <para>The example below shows a change to the default DoM limit on
417 the server to 64KB and try to create a file with 1MB DoM size
419 <screen>mds# lctl set_param -n lod.*MDT0000*.dom_stripesize=64K
420 mds# lctl get_param -n lod.*MDT0000*.dom_stripesize
423 client$ lfs setstripe -E 1M -L mdt /mnt/lustre/dom
424 Create composite file /mnt/lustre/dom failed. Invalid argument
425 error: setstripe: create composite file '/mnt/lustre/dom' failed:
426 Invalid argument</screen></para>
428 <section><title>Persistent Set Command</title>
429 <para>To persistently set the value of the parameter, the
430 <literal>lctl conf_param</literal> command is used:
431 <screen>lctl conf_param <fsname>-MDT<index>.lod.dom_stripesize=<value>
434 <section><title>Persistent Set Examples</title>
435 <para>The new value of the parameter is saved in config log
437 <screen>mgs# lctl conf_param lustre-MDT0000.lod.dom_stripesize=512K
438 mds# lctl get_param -n lod.*MDT0000*.dom_stripesize
440 New settings are applied in few seconds and saved persistently in
445 <section xml:id="dbdoclet.disabledom">
448 <primary>dom</primary>
451 <primary>dom</primary>
452 <secondary>disabledom</secondary>
453 </indexterm>Disable DoM</title>
454 <para>When <literal>lctl set_param</literal> or
455 <literal>lctl conf_param</literal> sets
456 <literal>dom_stripesize</literal> to <literal>0</literal>, DoM
457 component creation will be disabled on the selected server, and
458 any <emphasis>new</emphasis> layouts with a specified DoM component
459 will have that component removed from the file layout. Existing
460 files and layouts with DoM components on that MDT are not changed.
462 <note><para>DoM files can still be created in existing directories
463 with a default DoM layout.</para></note>