Whamcloud - gitweb
LUDOC-394 manual: Remove extra 'held' word
[doc/manual.git] / LazySizeOnMDT.xml
1 <?xml version='1.0' encoding='UTF-8'?>
2 <chapter xmlns="http://docbook.org/ns/docbook"
3  xmlns:xl="http://www.w3.org/1999/xlink" version="5.0" xml:lang="en-US"
4  xml:id="lsom" condition="l2C">
5   <title xml:id="lsom.title">Lazy Size on MDT (LSoM)</title>
6   <para>This chapter describes Lazy Size on MDT (LSoM).</para>
7   <section xml:id="lsomintro">
8     <title>
9     <indexterm>
10       <primary>lsom</primary>
11       <secondary>intro</secondary>
12     </indexterm>Introduction to Lazy Size on MDT (LSoM)</title>
13     <para>In the Lustre file system, MDSs store the ctime, mtime, owner,
14     and other file attributes. The OSSs store the size and number of
15     blocks used for each file. To obtain the correct file size, the client
16     must contact each OST that the file is stored across, which means
17     multiple RPCs to get the size and blocks for a file when a file is
18     striped over multiple OSTs. The Lazy Size on MDT (LSoM) feature stores
19     the file size on the MDS and avoids the need to fetch the file size
20     from the OST(s) in cases where the application understands that the
21     size may not be accurate. Lazy means there is no guarantee of the
22     accuracy of the attributes stored on the MDS.</para>
23     <para>Since many Lustre installations use SSD for MDT storage, the
24     motivation for the LSoM work is to speed up the time it takes to get
25     the size of a file from the Lustre file system by storing that data on
26     the MDTs. We expect this feature to be initially used by Lustre policy
27     engines that scan the backend MDT storage, make decisions based on broad
28     size categories, and do not depend on a totally accurate file size.
29     Examples include Lester, Robinhood, Zester, and various vendor offerings.
30     Future improvements will allow the LSoM data to be accessed by tools such
31     as <literal>lfs find</literal>.</para>
32   </section>
33   <section xml:id="enablelsom">
34     <title><indexterm><primary>lsom</primary>
35       <secondary>enablelsom</secondary></indexterm>Enable LSoM</title>
36     <para> LSoM is always enabled and nothing needs to be done to enable the
37     feature for fetching the LSoM data when scanning the MDT inodes with a
38     policy engine. It is also possible to access the LSoM data on the client
39     via the <literal>lfs getsom</literal> command.  Because the LSoM data is
40     currently accessed on the client via the xattr interface, the
41     <literal>xattr_cache</literal> will cache the file size and block count on
42     the client as long as the inode is cached.  In most cases this is
43     desirable, since it improves access to the LSoM data.  However, it also
44     means that the LSoM data may be stale if the file size is changed after the
45     xattr is first accessed or if the xattr is accessed shortly after the file
46     is first created.</para>
47     <para>If it is necessary to access up-to-date LSoM data that has gone
48     stale, it is possible to flush the xattr cache from the client by
49     cancelling the MDC locks via
50     <literal>lctl set_param ldlm.namespaces.*mdc*.lru_size=clear</literal>.
51     Otherwise, the file attributes will be dropped from the client cache if
52     the file has not been accessed before the LDLM lock timeout.  The timeout
53     is stored via
54     <literal>lctl get_param ldlm.namespaces.*mdc*.lru_max_age</literal>.</para>
55     <para>If repeated access to LSoM attributes for files that are recently
56     created or frequently modified from a specific client, such as an HSM agent
57     node, it is possible to disable xattr caching on a client via:
58     <literal>lctl set_param llite.*.xattr_cache=0</literal>.  This may cause
59     extra overhead when accessing files, and is not recommended for normal
60     usage.</para>
61   </section>
62   <section xml:id="usercmds">
63     <title><indexterm><primary>lsom</primary>
64       <secondary>usercommands</secondary></indexterm>User Commands</title>
65     <para>Lustre provides the <literal>lfs getsom</literal> command to list
66     file attributes that are stored on the MDT.</para>
67     <para>The <literal>llsom_sync</literal> command allows the user to sync
68     the file attributes on the MDT with the valid/up-to-date data on the
69     OSTs. <literal>llsom_sync</literal> is called on the client with the
70     Lustre file system mount point. <literal>llsom_sync</literal> uses Lustre
71     MDS changelogs and, thus, a changelog user must be registered to use this
72     utility.</para>
73     <section xml:id="lfsgetsom">
74       <title><indexterm><primary>lsom</primary>
75         <secondary>lfsgetsom</secondary></indexterm>lfs getsom for LSoM data
76       </title>
77       <para>The <literal>lfs getsom</literal> command lists file attributes
78       that are stored on the MDT. <literal>lfs getsom</literal> is called
79       with the full path and file name for a file on the Lustre file
80       system. If no flags are used, then all file attributes stored on the
81       MDS will be shown.</para>
82       <section><title>lfs getsom Command</title>
83         <para><screen>lfs getsom [-s] [-b] [-f] &lt;filename&gt;</screen>
84           The various <literal>lfs getsom</literal> options are listed and
85           described below.</para>
86         <informaltable frame="all">
87           <tgroup cols="2">
88             <colspec colname="c1" colwidth="3*" />
89             <colspec colname="c2" colwidth="7*" />
90             <thead>
91               <row>
92                 <entry>
93                   <para>
94                     <emphasis role="bold">Option</emphasis>
95                   </para>
96                 </entry>
97                 <entry>
98                   <para>
99                     <emphasis role="bold">Description</emphasis>
100                   </para>
101                 </entry>
102               </row>
103             </thead>
104             <tbody>
105               <row>
106                 <entry>
107                   <para>
108                     <literal>-s</literal>
109                   </para>
110                 </entry>
111                 <entry>
112                   <para>Only show the size value of the LSoM data for a given
113                   file. This is an optional flag</para>
114                 </entry>
115               </row>
116               <row>
117                 <entry>
118                   <para>
119                     <literal>-b</literal>
120                   </para>
121                 </entry>
122                 <entry>
123                   <para>Only show the blocks value of the LSoM data for a
124                   given file. This is an optional flag</para>
125                 </entry>
126               </row>
127               <row>
128                 <entry>
129                   <para>
130                     <literal>-f</literal>
131                   </para>
132                 </entry>
133                 <entry>
134                   <para>Only show the flag value of the LSoM data for a given
135                   file. This is an optional flag. Valid flags are:</para>
136                   <para>SOM_FL_UNKNOWN = 0x0000 - Unknown or no SoM data,
137                    must get size from OSTs.</para>
138                   <para>SOM_FL_STRICT = 0x0001 - Known strictly correct, FLR
139                   file (SoM guaranteed)</para>
140                   <para>SOM_FL_STALE = 0x0002 - Known stale -was right at
141                   some point in the past, but it is known (or likely) to be
142                   incorrect now (e.g. opened for write)</para>
143                   <para>SOM_FL_LAZY= 0x0004 - Approximate, may never have
144                   been strictly correct, need to sync SOM data to achieve
145                   eventual consistency.</para>
146                 </entry>
147               </row>
148             </tbody>
149           </tgroup>
150         </informaltable>
151       </section>
152     </section>
153     <section><title>Syncing LSoM data</title>
154     <para>The <literal>llsom_sync</literal> command allows the user to sync
155       the file attributes on the MDT with the valid/up-to-date data on the
156       OSTs. <literal>llsom_sync</literal> is called on the client with the
157       client mount point for the Lustre file system.
158       <literal>llsom_sync</literal> uses Lustre MDS changelogs and, thus, a
159       changelog user must be registered to use this utility.</para>
160     <section><title>llsom_sync Command</title>
161       <screen>llsom_sync --mdt|-m &lt;mdt&gt; --user|-u &lt;user_id&gt;
162               [--daemonize|-d] [--verbose|-v] [--interval|-i] [--min-age|-a]
163               [--max-cache|-c] [--sync|-s] &lt;lustre_mount_point&gt;</screen>
164       <para>The various <literal>llsom_sync</literal> options are
165       listed and described below.</para>
166       <informaltable frame="all">
167         <tgroup cols="2">
168           <colspec colname="c1" colwidth="3*" />
169           <colspec colname="c2" colwidth="7*" />
170           <thead>
171             <row>
172               <entry>
173                 <para><emphasis role="bold">Option</emphasis></para>
174               </entry>
175               <entry>
176                 <para><emphasis role="bold">Description</emphasis></para>
177               </entry>
178             </row>
179           </thead>
180           <tbody>
181             <row>
182               <entry>
183                 <para><literal>--mdt | -m &lt;mdt&gt;</literal></para>
184               </entry>
185               <entry>
186                 <para>The metadata device which need to be synced the LSoM
187                 xattr of files. A changelog user must be registered for
188                 this device.Required flag.</para>
189               </entry>
190             </row>
191             <row>
192               <entry>
193                 <para><literal>--user | -u &lt;user_id&gt;</literal></para>
194               </entry>
195               <entry>
196                 <para>The changelog user id for the MDT device. Required
197                 flag.</para>
198               </entry>
199             </row>
200             <row>
201               <entry>
202                 <para><literal>--daemonize | -d</literal></para>
203               </entry>
204               <entry>
205                 <para>Optional flag to “daemonize” the program. In daemon
206                 mode, the utility will scan, process the changelog records
207                 and sync the LSoM xattr for files periodically.</para>
208               </entry>
209             </row>
210             <row>
211               <entry>
212                 <para><literal>--verbose | -v</literal></para>
213               </entry>
214               <entry>
215                 <para>Optional flag to produce verbose output.</para>
216               </entry>
217             </row>
218             <row>
219               <entry>
220                 <para><literal>--interval | -i</literal></para>
221               </entry>
222               <entry>
223                 <para>Optional flag for the time interval to scan the
224                 Lustre changelog and process the log record in daemon
225                 mode.</para>
226               </entry>
227             </row>
228             <row>
229               <entry>
230                 <para><literal>--min-age | -a</literal></para>
231               </entry>
232               <entry>
233                 <para>Optional flag for the time that
234                 <literal>llsom_sync</literal> tool will not try to sync the
235                 LSoM data for any files closed less than this many seconds
236                 old. The default min-age value is 600s(10 minutes).</para>
237               </entry>
238             </row>
239             <row>
240               <entry>
241                 <para><literal>--max-cache | -c</literal></para>
242               </entry>
243               <entry>
244                 <para>Optional flag for the total memory used for the FID
245                 cache which can be with a suffix [KkGgMm].The default
246                 max-cache value is 256MB. For the parameter value &lt; 100,
247                 it is taken as the percentage of total memory size used for
248                 the FID cache instead of the cache size.</para>
249               </entry>
250             </row>
251             <row>
252               <entry>
253                 <para><literal>--sync | -s</literal></para>
254               </entry>
255               <entry>
256                 <para>Optional flag to sync file data to make the dirty
257                 data out of cache to ensure the blocks count is correct
258                 when update the file LSoM xattr. This option could hurt
259                 server performance significantly if thousands of fsync
260                 requests are sent.</para>
261               </entry>
262             </row>
263           </tbody>
264         </tgroup>
265       </informaltable>
266     </section>
267     </section>
268   </section>
269 </chapter>
270 <!--
271   vim:expandtab:shiftwidth=2:tabstop=8:
272   -->