Whamcloud - gitweb
LUDOC-307 example: example output for obdfilter-survey.
[doc/manual.git] / BenchmarkingTests.xml
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="benchmarkingtests">
2   <title xml:id="benchmarkingtests.title">Benchmarking Lustre File System Performance (Lustre I/O
3     Kit)</title>
4   <para>This chapter describes the Lustre I/O kit, a collection of I/O benchmarking tools for a
5     Lustre cluster, and PIOS, a parallel I/O simulator for Linux and
6       Solaris<superscript>*</superscript> operating systems. It includes:</para>
7   <itemizedlist>
8     <listitem>
9       <para><xref linkend="dbdoclet.50438212_44437"/></para>
10     </listitem>
11     <listitem>
12       <para><xref linkend="dbdoclet.50438212_51053"/></para>
13     </listitem>
14     <listitem>
15       <para><xref linkend="dbdoclet.50438212_26516"/></para>
16     </listitem>
17     <listitem>
18       <para><xref linkend="dbdoclet.50438212_85136"/></para>
19     </listitem>
20     <listitem>
21       <para><xref linkend="mds_survey_ref"/></para>
22     </listitem>
23     <listitem>
24       <para><xref linkend="dbdoclet.50438212_58201"/></para>
25     </listitem>
26   </itemizedlist>
27   <section xml:id="dbdoclet.50438212_44437">
28       <title>
29           <indexterm><primary>benchmarking</primary><secondary>with Lustre I/O Kit</secondary></indexterm>
30           <indexterm><primary>profiling</primary><see>benchmarking</see></indexterm>
31           <indexterm><primary>tuning</primary><see>benchmarking</see></indexterm>
32           <indexterm><primary>performance</primary><see>benchmarking</see></indexterm>
33           
34           Using Lustre I/O Kit Tools</title>
35     <para>The tools in the Lustre I/O Kit are used to benchmark Lustre file system hardware and
36       validate that it is working as expected before you install the Lustre software. It can also be
37       used to to validate the performance of the various hardware and software layers in the cluster
38       and also to find and troubleshoot I/O issues.</para>
39     <para>Typically, performance is measured starting with single raw devices and then proceeding to groups of devices. Once raw performance has been established, other software layers are then added incrementally and tested.</para>
40     <section remap="h3">
41       <title>Contents of the Lustre I/O Kit</title>
42       <para>The I/O kit contains three tests, each of which tests a progressively higher layer in
43         the Lustre software stack:</para>
44       <itemizedlist>
45         <listitem>
46           <para><literal>sgpdd-survey</literal> - Measure basic &apos;bare metal&apos; performance
47             of devices while bypassing the kernel block device layers, buffer cache, and file
48             system.</para>
49         </listitem>
50         <listitem>
51           <para><literal>obdfilter-survey</literal> - Measure the performance of one or more OSTs
52             directly on the OSS node or alternately over the network from a Lustre client.</para>
53         </listitem>
54         <listitem>
55           <para><literal>ost-survey</literal> - Performs I/O against OSTs individually to allow
56             performance comparisons to detect if an OST is performing suboptimally due to hardware
57             issues.</para>
58         </listitem>
59       </itemizedlist>
60       <para>Typically with these tests, a Lustre file system should deliver 85-90% of the raw device
61         performance.</para>
62       <para>A utility <literal>stats-collect</literal> is also provided to collect application profiling information from Lustre clients and servers. See <xref linkend="dbdoclet.50438212_58201"/> for more information.</para>
63     </section>
64     <section remap="h3">
65       <title>Preparing to Use the Lustre I/O Kit</title>
66       <para>The following prerequisites must be met to use the tests in the Lustre I/O kit:</para>
67       <itemizedlist>
68         <listitem>
69           <para>Password-free remote access to nodes in the system (provided by <literal>ssh</literal> or <literal>rsh</literal>).</para>
70         </listitem>
71         <listitem>
72           <para>LNET self-test completed to test that Lustre networking has been properly installed
73             and configured. See <xref linkend="lnetselftest"/>.</para>
74         </listitem>
75         <listitem>
76           <para>Lustre file system software installed.</para>
77         </listitem>
78         <listitem>
79           <para><literal>sg3_utils</literal>  package providing the <literal>sgp_dd</literal> tool (<literal>sg3_utils</literal> is a separate RPM package available online using YUM).</para>
80         </listitem>
81       </itemizedlist>
82       <para>Download the Lustre I/O kit (<literal>lustre-iokit</literal>)from:</para>
83       <para><link xl:href="http://downloads.hpdd.intel.com/">http://downloads.hpdd.intel.com/</link></para>
84     </section>
85   </section>
86   <section xml:id="dbdoclet.50438212_51053">
87     <title><indexterm>
88         <primary>benchmarking</primary>
89         <secondary>raw hardware with sgpdd-survey</secondary>
90       </indexterm>Testing I/O Performance of Raw Hardware (<literal>sgpdd-survey</literal>)</title>
91     <para>The <literal>sgpdd-survey</literal> tool is used to test bare metal I/O performance of the
92       raw hardware, while bypassing as much of the kernel as possible. This survey may be used to
93       characterize the performance of a SCSI device by simulating an OST serving multiple stripe
94       files. The data gathered by this survey can help set expectations for the performance of a
95       Lustre OST using this device.</para>
96     <para>The script uses <literal>sgp_dd</literal> to carry out raw sequential disk I/O. It runs with variable numbers of <literal>sgp_dd</literal> threads to show how performance varies with different request queue depths.</para>
97     <para>The script spawns variable numbers of <literal>sgp_dd</literal> instances, each reading or writing a separate area of the disk to demonstrate performance variance within a number of concurrent stripe files.</para>
98     <para>Several tips and insights for disk performance measurement are described below. Some of this information is specific to RAID arrays and/or the Linux RAID implementation.</para>
99     <itemizedlist>
100       <listitem>
101         <para><emphasis>Performance is limited by the slowest disk.</emphasis></para>
102         <para>Before creating a RAID array, benchmark all disks individually. We have frequently encountered situations where drive performance was not consistent for all devices in the array. Replace any disks that are significantly slower than the rest.</para>
103       </listitem>
104       <listitem>
105         <para><emphasis>Disks and arrays are very sensitive to request size.</emphasis></para>
106         <para>To identify the optimal request size for a given disk, benchmark the disk with different record sizes ranging from 4 KB to 1 to 2 MB.</para>
107       </listitem>
108     </itemizedlist>
109     <caution>
110       <para>The <literal>sgpdd-survey</literal> script overwrites the device being tested, which
111         results in the <emphasis>
112           <emphasis role="bold">LOSS OF ALL DATA</emphasis>
113         </emphasis> on that device. Exercise caution when selecting the device to be tested.</para>
114     </caution>
115     <note>
116       <para>Array performance with all LUNs loaded does not always match the performance of a single LUN when tested in isolation.</para>
117     </note>
118     <para><emphasis role="bold">Prerequisites:</emphasis></para>
119     <itemizedlist>
120       <listitem>
121         <para><literal>sgp_dd</literal>  tool in the <literal>sg3_utils</literal> package</para>
122       </listitem>
123       <listitem>
124         <para>Lustre software is <emphasis>NOT</emphasis> required</para>
125       </listitem>
126     </itemizedlist>
127     <para>The device(s) being tested must meet one of these two requirements:</para>
128     <itemizedlist>
129       <listitem>
130         <para>If the device is a SCSI device, it must appear in the output of <literal>sg_map</literal> (make sure the kernel module <literal>sg</literal> is loaded).</para>
131       </listitem>
132       <listitem>
133         <para>If the device is a raw device, it must appear in the output of <literal>raw -qa</literal>.</para>
134       </listitem>
135     </itemizedlist>
136     <para>Raw and SCSI devices cannot be mixed in the test specification.</para>
137     <note>
138       <para>If you need to create raw devices to use the <literal>sgpdd-survey</literal> tool, note
139         that raw device 0 cannot be used due to a bug in certain versions of the &quot;raw&quot;
140         utility (including the version shipped with Red Hat Enterprise Linux 4U4.)</para>
141     </note>
142     <section remap="h3">
143       <title><indexterm><primary>benchmarking</primary><secondary>tuning storage</secondary></indexterm>Tuning Linux Storage Devices</title>
144       <para>To get large I/O transfers (1 MB) to disk, it may be necessary to tune several kernel parameters as specified:</para>
145       <screen>/sys/block/sdN/queue/max_sectors_kb = 4096
146 /sys/block/sdN/queue/max_phys_segments = 256
147 /proc/scsi/sg/allow_dio = 1
148 /sys/module/ib_srp/parameters/srp_sg_tablesize = 255
149 /sys/block/sdN/queue/scheduler</screen>
150       <note>
151         <para>Recommended schedulers are <emphasis role="bold">deadline</emphasis> and <emphasis
152             role="bold">noop</emphasis>. The  scheduler is set by default to <emphasis role="bold"
153             >deadline</emphasis>, unless it has already been set to <emphasis role="bold"
154             >noop</emphasis>.</para>
155       </note>
156     </section>
157     <section remap="h3">
158       <title>Running sgpdd-survey</title>
159       <para>The <literal>sgpdd-survey</literal> script must be customized for the particular device
160         being tested and for the location where the script saves its working and result files (by
161         specifying the <literal>${rslt}</literal> variable). Customization variables are described
162         at the beginning of the script.</para>
163       <para>When the <literal>sgpdd-survey</literal> script runs, it creates a number of working
164         files and a pair of result files. The names of all the files created start with the prefix
165         defined in the variable <literal>${rslt}</literal>. (The default value is
166           <literal>/tmp</literal>.) The files include:</para>
167       <itemizedlist>
168         <listitem>
169           <para>File containing standard output data (same as <literal>stdout</literal>)</para>
170           <screen><replaceable>rslt_date_time</replaceable>.summary</screen>
171         </listitem>
172         <listitem>
173           <para>Temporary (tmp) files</para>
174           <screen><replaceable>rslt_date_time</replaceable>_*
175 </screen>
176         </listitem>
177         <listitem>
178           <para>Collected tmp files for post-mortem</para>
179           <screen><replaceable>rslt_date_time</replaceable>.detail
180 </screen>
181         </listitem>
182       </itemizedlist>
183       <para>The <literal>stdout</literal> and the <literal>.summary</literal> file will contain lines like this:</para>
184       <screen>total_size 8388608K rsz 1024 thr 1 crg 1 180.45 MB/s 1 x 180.50 \
185         = 180.50 MB/s
186 </screen>
187       <para>Each line corresponds to a run of the test. Each test run will have a different number of threads, record size, or number of regions.</para>
188       <itemizedlist>
189         <listitem>
190           <para><literal>total_size</literal>  - Size of file being tested in KBs (8 GB in above example).</para>
191         </listitem>
192         <listitem>
193           <para><literal>rsz</literal>  - Record size in KBs (1 MB in above example).</para>
194         </listitem>
195         <listitem>
196           <para><literal>thr</literal>  - Number of threads generating I/O (1 thread in above example).</para>
197         </listitem>
198         <listitem>
199           <para><literal>crg</literal> - Current regions, the number of disjoint areas on the disk to which I/O is being sent (1 region in above example, indicating that no seeking is done).</para>
200         </listitem>
201         <listitem>
202           <para><literal>MB/s</literal>  - Aggregate bandwidth measured by dividing the total amount of data by the elapsed time (180.45 MB/s in the above example).</para>
203         </listitem>
204         <listitem>
205           <para><literal>MB/s</literal>  - The remaining numbers show the number of regions X performance of the slowest disk as a sanity check on the aggregate bandwidth.</para>
206         </listitem>
207       </itemizedlist>
208       <para>If there are so many threads that the <literal>sgp_dd</literal> script is unlikely to be able to allocate I/O buffers, then <literal>ENOMEM</literal> is printed in place of the aggregate bandwidth result.</para>
209       <para>If one or more <literal>sgp_dd</literal> instances do not successfully report a bandwidth number, then <literal>FAILED</literal> is printed in place of the aggregate bandwidth result.</para>
210     </section>
211   </section>
212   <section xml:id="dbdoclet.50438212_26516">
213     <title><indexterm>
214         <primary>benchmarking</primary>
215         <secondary>OST performance</secondary>
216       </indexterm>Testing OST Performance (<literal>obdfilter-survey</literal>)</title>
217     <para>The <literal>obdfilter-survey</literal> script generates sequential I/O from varying
218       numbers of threads and objects (files) to simulate the I/O patterns of a Lustre client.</para>
219     <para>The <literal>obdfilter-survey</literal> script can be run directly on the OSS node to
220       measure the OST storage performance without any intervening network, or it can be run remotely
221       on a Lustre client to measure the OST performance including network overhead.</para>
222     <para>The <literal>obdfilter-survey</literal> is used to characterize the performance of the
223       following:</para>
224     <itemizedlist>
225       <listitem>
226         <para><emphasis role="bold">Local file system</emphasis> - In this mode, the
227             <literal>obdfilter-survey</literal> script exercises one or more instances of the
228           obdfilter directly. The script may run on one or more OSS nodes, for example, when the
229           OSSs are all attached to the same multi-ported disk subsystem.</para>
230         <para>Run the script using the <literal>case=disk</literal> parameter to run the test against all the local OSTs. The script automatically detects all local OSTs and includes them in the survey.</para>
231         <para>To run the test against only specific OSTs, run the script using the <literal>targets=parameter</literal> to list the OSTs to be tested explicitly. If some OSTs are on remote nodes, specify their hostnames in addition to the OST name (for example, <literal>oss2:lustre-OST0004</literal>).</para>
232         <para>All <literal>obdfilter</literal> instances are driven directly. The script automatically loads the <literal>obdecho</literal> module (if required) and creates one instance of <literal>echo_client</literal> for each <literal>obdfilter</literal> instance in order to generate I/O requests directly to the OST.</para>
233         <para>For more details, see <xref linkend="dbdoclet.50438212_59319"/>.</para>
234       </listitem>
235       <listitem>
236         <para><emphasis role="bold">Network</emphasis>  - In this mode, the Lustre client generates I/O requests over the network but these requests are not sent to the OST file system. The OSS node runs the obdecho server to receive the requests but discards them before they are sent to the disk.</para>
237         <para>Pass the parameters <literal>case=network</literal> and <literal>targets=<replaceable>hostname|IP_of_server</replaceable></literal> to the script. For each network case, the script does the required setup.</para>
238         <para>For more details, see <xref linkend="dbdoclet.50438212_36037"/></para>
239       </listitem>
240       <listitem>
241         <para><emphasis role="bold">Remote file system over the network</emphasis> - In this mode
242           the <literal>obdfilter-survey</literal> script generates I/O from a Lustre client to a
243           remote OSS to write the data to the file system.</para>
244         <para>To run the test against all the local OSCs, pass the parameter <literal>case=netdisk</literal> to the script. Alternately you can pass the target= parameter with one or more OSC devices (e.g., <literal>lustre-OST0000-osc-ffff88007754bc00</literal>) against which the tests are to be run.</para>
245         <para>For more details, see <xref linkend="dbdoclet.50438212_62662"/>.</para>
246       </listitem>
247     </itemizedlist>
248     <caution>
249       <para>The <literal>obdfilter-survey</literal> script is potentially destructive and there is a
250         small risk data may be lost. To reduce this risk, <literal>obdfilter-survey</literal> should
251         not be run on devices that contain data that needs to be preserved. Thus, the best time to
252         run <literal>obdfilter-survey</literal> is before the Lustre file system is put into
253         production. The reason <literal>obdfilter-survey</literal> may be safe to run on a
254         production file system is because it creates objects with object sequence 2. Normal file
255         system objects are typically created with object sequence 0.</para>
256     </caution>
257     <note>
258       <para>If the <literal>obdfilter-survey</literal> test is terminated before it completes, some
259         small amount of space is leaked. you can either ignore it or reformat the file
260         system.</para>
261     </note>
262     <note>
263       <para>The <literal>obdfilter-survey</literal> script is <emphasis>NOT</emphasis> scalable
264         beyond tens of OSTs since it is only intended to measure the I/O performance of individual
265         storage subsystems, not the scalability of the entire system.</para>
266     </note>
267     <note>
268       <para>The <literal>obdfilter-survey</literal> script must be customized, depending on the
269         components under test and where the script&apos;s working files should be kept.
270         Customization variables are described at the beginning of the
271           <literal>obdfilter-survey</literal> script. In particular, pay attention to the listed
272         maximum values listed for each parameter in the script.</para>
273     </note>
274     <section xml:id="dbdoclet.50438212_59319">
275       <title><indexterm><primary>benchmarking</primary><secondary>local disk</secondary></indexterm>Testing Local Disk Performance</title>
276       <para>The <literal>obdfilter-survey</literal> script can be run automatically or manually
277         against a local disk. This script profiles the overall throughput of storage hardware,
278         including the file system and RAID layers managing the storage, by sending workloads to the
279         OSTs that vary in thread count, object count, and I/O size.</para>
280       <para>When the <literal>obdfilter-survey</literal> script is run, it provides information
281         about the performance abilities of the storage hardware and shows the saturation
282         points.</para>
283       <para>The <literal>plot-obdfilter</literal> script generates from the output of the
284           <literal>obdfilter-survey</literal> a CSV file and parameters for importing into a
285         spreadsheet or gnuplot to visualize the data.</para>
286       <para>To run the <literal>obdfilter-survey</literal> script, create a standard Lustre file
287         system configuration; no special setup is needed.</para>
288       <para><emphasis role="bold">To perform an automatic run:</emphasis></para>
289       <orderedlist>
290         <listitem>
291           <para>Start the Lustre OSTs.</para>
292           <para>The Lustre OSTs should be mounted on the OSS node(s) to be tested. The Lustre client is not required to be mounted at this time.</para>
293         </listitem>
294         <listitem>
295           <para>Verify that the obdecho module is loaded. Run:</para>
296           <screen>modprobe obdecho</screen>
297         </listitem>
298         <listitem>
299           <para>Run the <literal>obdfilter-survey</literal> script with the parameter
300               <literal>case=disk</literal>.</para>
301           <para>For example, to run a local test with up to two objects (nobjhi), up to two threads (thrhi), and 1024 MB transfer size (size):</para>
302           <screen>$ nobjhi=2 thrhi=2 size=1024 case=disk sh obdfilter-survey</screen>
303         </listitem>
304         <listitem>
305                 <para>Performance measurements for write, rewrite, read etc are provided below:</para>
306                 <screen># example output
307 Fri Sep 25 11:14:03 EDT 2015 Obdfilter-survey for case=disk from hds1fnb6123
308 ost 10 sz 167772160K rsz 1024K obj   10 thr   10 write 10982.73 [ 601.97,2912.91] rewrite 15696.54 [1160.92,3450.85] read 12358.60 [ 938.96,2634.87] 
309 ...</screen>
310                 <para>The file <literal>./lustre-iokit/obdfilter-survey/README.obdfilter-survey</literal>
311                 provides an explaination for the output as follows:</para>
312                 <screen>ost 10          is the total number of OSTs under test.
313 sz 167772160K   is the total amount of data read or written (in bytes).
314 rsz 1024K       is the record size (size of each echo_client I/O, in bytes).
315 obj    10       is the total number of objects over all OSTs
316 thr    10       is the total number of threads over all OSTs and objects
317 write           is the test name.  If more tests have been specified they
318            all appear on the same line.
319 10982.73        is the aggregate bandwidth over all OSTs measured by
320            dividing the total number of MB by the elapsed time.
321 [601.97,2912.91] are the minimum and maximum instantaneous bandwidths seen on
322            any individual OST.
323 Note that although the numbers of threads and objects are specifed per-OST
324 in the customization section of the script, results are reported aggregated
325 over all OSTs.</screen>
326         </listitem>
327       </orderedlist>
328       <para><emphasis role="italic">To perform a manual run:</emphasis></para>
329       <orderedlist>
330         <listitem>
331           <para>Start the Lustre OSTs.</para>
332           <para>The Lustre OSTs should be mounted on the OSS node(s) to be tested. The Lustre client is not required to be mounted at this time.</para>
333         </listitem>
334         <listitem>
335           <para>Verify that the <literal>obdecho</literal> module is loaded. Run:</para>
336           <screen>modprobe obdecho</screen>
337         </listitem>
338         <listitem>
339           <para>Determine the OST names.</para>
340           <para>On the OSS nodes to be tested, run the <literal>lctl dl</literal> command. The OST device names are listed in the fourth column of the output. For example:</para>
341           <screen>$ lctl dl |grep obdfilter
342 0 UP obdfilter lustre-OST0001 lustre-OST0001_UUID 1159
343 2 UP obdfilter lustre-OST0002 lustre-OST0002_UUID 1159
344 ...</screen>
345         </listitem>
346         <listitem>
347           <para>List all OSTs you want to test.</para>
348           <para>Use the <literal>targets=parameter</literal> to list the OSTs separated by spaces. List the individual OSTs by name using the format
349               <literal><replaceable>fsname</replaceable>-<replaceable>OSTnumber</replaceable></literal>
350             (for example, <literal>lustre-OST0001</literal>). You do not have to specify an MDS or LOV.</para>
351         </listitem>
352         <listitem>
353           <para>Run the <literal>obdfilter-survey</literal> script with the
354               <literal>targets=parameter</literal>.</para>
355           <para>For example, to run a local test with up to two objects (<literal>nobjhi</literal>), up to two threads (<literal>thrhi</literal>), and 1024 Mb (size) transfer size:</para>
356           <screen>$ nobjhi=2 thrhi=2 size=1024 targets=&quot;lustre-OST0001 \
357            lustre-OST0002&quot; sh obdfilter-survey</screen>
358         </listitem>
359       </orderedlist>
360     </section>
361     <section xml:id="dbdoclet.50438212_36037">
362       <title><indexterm><primary>benchmarking</primary><secondary>network</secondary></indexterm>Testing Network Performance</title>
363       <para>The <literal>obdfilter-survey</literal> script can only be run automatically against a
364         network; no manual test is provided.</para>
365       <para>To run the network test, a specific Lustre file system setup is needed. Make sure that
366         these configuration requirements have been met.</para>
367       <para><emphasis role="bold">To perform an automatic run:</emphasis></para>
368       <orderedlist>
369         <listitem>
370           <para>Start the Lustre OSTs.</para>
371           <para>The Lustre OSTs should be mounted on the OSS node(s) to be tested. The Lustre client is not required to be mounted at this time.</para>
372         </listitem>
373         <listitem>
374           <para>Verify that the <literal>obdecho</literal> module is loaded. Run:</para>
375           <screen>modprobe obdecho</screen>
376         </listitem>
377         <listitem>
378           <para>Start <literal>lctl</literal> and check the device list, which must be empty. Run:</para>
379           <screen>lctl dl</screen>
380         </listitem>
381         <listitem>
382           <para>Run the <literal>obdfilter-survey</literal> script with the parameters
383               <literal>case=network</literal> and
384                 <literal>targets=<replaceable>hostname|ip_of_server</replaceable></literal>. For
385             example:</para>
386           <screen>$ nobjhi=2 thrhi=2 size=1024 targets=&quot;oss0 oss1&quot; \
387            case=network sh obdfilter-survey</screen>
388         </listitem>
389         <listitem>
390           <para>On the server side, view the statistics at:</para>
391           <screen>/proc/fs/lustre/obdecho/<replaceable>echo_srv</replaceable>/stats</screen>
392           <para>where <literal><replaceable>echo_srv</replaceable></literal>
393             is the <literal>obdecho</literal> server created by the script.</para>
394         </listitem>
395       </orderedlist>
396     </section>
397     <section xml:id="dbdoclet.50438212_62662">
398       <title><indexterm><primary>benchmarking</primary><secondary>remote disk</secondary></indexterm>Testing Remote Disk Performance</title>
399       <para>The <literal>obdfilter-survey</literal> script can be run automatically or manually
400         against a network disk. To run the network disk test, start with a standard Lustre
401         configuration. No special setup is needed.</para>
402       <para><emphasis role="bold">To perform an automatic run:</emphasis></para>
403       <orderedlist>
404         <listitem>
405           <para>Start the Lustre OSTs.</para>
406           <para>The Lustre OSTs should be mounted on the OSS node(s) to be tested. The Lustre client is not required to be mounted at this time.</para>
407         </listitem>
408         <listitem>
409           <para>Verify that the <literal>obdecho</literal> module is loaded. Run:</para>
410           <screen>modprobe obdecho</screen>
411         </listitem>
412         <listitem>
413           <para>Run the <literal>obdfilter-survey</literal> script with the parameter
414               <literal>case=netdisk</literal>. For example:</para>
415           <screen>$ nobjhi=2 thrhi=2 size=1024 case=netdisk sh obdfilter-survey
416 </screen>
417         </listitem>
418       </orderedlist>
419       <para><emphasis role="bold">To perform a manual run:</emphasis></para>
420       <orderedlist>
421         <listitem>
422           <para>Start the Lustre OSTs.</para>
423           <para>The Lustre OSTs should be mounted on the OSS node(s) to be tested. The Lustre client is not required to be mounted at this time.</para>
424         </listitem>
425         <listitem>
426           <para>Verify that the <literal>obdecho</literal> module is loaded. Run:</para>
427           <para>modprobe obdecho</para>
428         </listitem>
429         <listitem>
430           <para>Determine the OSC names.</para>
431           <para>On the OSS nodes to be tested, run the <literal>lctl dl</literal> command. The OSC device names are listed in the fourth column of the output. For example:</para>
432           <screen>$ lctl dl |grep obdfilter
433 3 UP osc lustre-OST0000-osc-ffff88007754bc00 \
434            54b91eab-0ea9-1516-b571-5e6df349592e 5
435 4 UP osc lustre-OST0001-osc-ffff88007754bc00 \
436            54b91eab-0ea9-1516-b571-5e6df349592e 5
437 ...
438 </screen>
439         </listitem>
440         <listitem>
441           <para>List all OSCs you want to test.</para>
442           <para>Use the <literal>targets=parameter</literal> to list the OSCs separated by spaces. List the individual OSCs by name separated by spaces using the format <literal><replaceable>fsname</replaceable>-<replaceable>OST_name</replaceable>-osc-<replaceable>instance</replaceable></literal> (for example, <literal>lustre-OST0000-osc-ffff88007754bc00</literal>). You <emphasis>do not have to specify an MDS or LOV.</emphasis></para>
443         </listitem>
444         <listitem>
445           <para>Run the <literal>obdfilter-survey</literal> script with the
446                 <literal>targets=<replaceable>osc</replaceable></literal> and
447               <literal>case=netdisk</literal>.</para>
448           <para>An example of a local test run with up to two objects (<literal>nobjhi</literal>), up to two threads (<literal>thrhi</literal>), and 1024 Mb (size) transfer size is shown below:</para>
449           <screen>$ nobjhi=2 thrhi=2 size=1024 \
450            targets=&quot;lustre-OST0000-osc-ffff88007754bc00 \
451            lustre-OST0001-osc-ffff88007754bc00&quot; sh obdfilter-survey
452 </screen>
453         </listitem>
454       </orderedlist>
455     </section>
456     <section remap="h3">
457       <title>Output Files</title>
458       <para>When the <literal>obdfilter-survey</literal> script runs, it creates a number of working
459         files and a pair of result files. All files start with the prefix defined in the variable
460           <literal>${rslt}</literal>.</para>
461       <informaltable frame="all">
462         <tgroup cols="2">
463           <colspec colname="c1" colwidth="50*"/>
464           <colspec colname="c2" colwidth="50*"/>
465           <thead>
466             <row>
467               <entry>
468                 <para><emphasis role="bold">File</emphasis></para>
469               </entry>
470               <entry>
471                 <para><emphasis role="bold">Description</emphasis></para>
472               </entry>
473             </row>
474           </thead>
475           <tbody>
476             <row>
477               <entry>
478                 <para> <literal>${rslt}.summary</literal></para>
479               </entry>
480               <entry>
481                 <para> Same as stdout</para>
482               </entry>
483             </row>
484             <row>
485               <entry>
486                 <para> <literal>${rslt}.script_*</literal></para>
487               </entry>
488               <entry>
489                 <para> Per-host test script files</para>
490               </entry>
491             </row>
492             <row>
493               <entry>
494                 <para> <literal>${rslt}.detail_tmp*</literal></para>
495               </entry>
496               <entry>
497                 <para> Per-OST result files</para>
498               </entry>
499             </row>
500             <row>
501               <entry>
502                 <para> <literal>${rslt}.detail</literal></para>
503               </entry>
504               <entry>
505                 <para> Collected result files for post-mortem</para>
506               </entry>
507             </row>
508           </tbody>
509         </tgroup>
510       </informaltable>
511       <para>The <literal>obdfilter-survey</literal> script iterates over the given number of threads
512         and objects performing the specified tests and checks that all test processes have completed
513         successfully.</para>
514       <note>
515         <para>The <literal>obdfilter-survey</literal> script may not clean up properly if it is
516           aborted or if it encounters an unrecoverable error. In this case, a manual cleanup may be
517           required, possibly including killing any running instances of <literal>lctl</literal>
518           (local or remote), removing <literal>echo_client</literal> instances created by the script
519           and unloading <literal>obdecho</literal>.</para>
520       </note>
521       <section remap="h4">
522         <title>Script Output</title>
523         <para>The <literal>.summary</literal> file and <literal>stdout</literal> of the
524             <literal>obdfilter-survey</literal> script contain lines like:</para>
525         <screen>ost 8 sz 67108864K rsz 1024 obj 8 thr 8 write 613.54 [ 64.00, 82.00]
526 </screen>
527         <para>Where:</para>
528         <informaltable frame="all">
529           <tgroup cols="2">
530             <colspec colname="c1" colwidth="50*"/>
531             <colspec colname="c2" colwidth="50*"/>
532             <thead>
533               <row>
534                 <entry>
535                   <para><emphasis role="bold">Parameter and value</emphasis></para>
536                 </entry>
537                 <entry>
538                   <para><emphasis role="bold">Description</emphasis></para>
539                 </entry>
540               </row>
541             </thead>
542             <tbody>
543               <row>
544                 <entry>
545                   <para> ost 8</para>
546                 </entry>
547                 <entry>
548                   <para> Total number of OSTs being tested.</para>
549                 </entry>
550               </row>
551               <row>
552                 <entry>
553                   <para> sz 67108864K</para>
554                 </entry>
555                 <entry>
556                   <para> Total amount of data read or written (in KB).</para>
557                 </entry>
558               </row>
559               <row>
560                 <entry>
561                   <para> rsz 1024</para>
562                 </entry>
563                 <entry>
564                   <para> Record size (size of each echo_client I/O, in KB).</para>
565                 </entry>
566               </row>
567               <row>
568                 <entry>
569                   <para> obj 8</para>
570                 </entry>
571                 <entry>
572                   <para> Total number of objects over all OSTs.</para>
573                 </entry>
574               </row>
575               <row>
576                 <entry>
577                   <para> thr 8</para>
578                 </entry>
579                 <entry>
580                   <para> Total number of threads over all OSTs and objects.</para>
581                 </entry>
582               </row>
583               <row>
584                 <entry>
585                   <para> write</para>
586                 </entry>
587                 <entry>
588                   <para> Test name. If more tests have been specified, they all appear on the same line.</para>
589                 </entry>
590               </row>
591               <row>
592                 <entry>
593                   <para> 613.54</para>
594                 </entry>
595                 <entry>
596                   <para> Aggregate bandwidth over all OSTs (measured by dividing the total number of MB by the elapsed time).</para>
597                 </entry>
598               </row>
599               <row>
600                 <entry>
601                   <para> [64, 82.00]</para>
602                 </entry>
603                 <entry>
604                   <para> Minimum and maximum instantaneous bandwidths on an individual OST.</para>
605                 </entry>
606               </row>
607             </tbody>
608           </tgroup>
609         </informaltable>
610         <note>
611           <para>Although the numbers of threads and objects are specified per-OST in the customization section of the script, the reported results are aggregated over all OSTs.</para>
612         </note>
613       </section>
614       <section remap="h4">
615         <title>Visualizing Results</title>
616         <para>It is useful to import the <literal>obdfilter-survey</literal> script summary data (it
617           is fixed width) into Excel (or any graphing package) and graph the bandwidth versus the
618           number of threads for varying numbers of concurrent regions. This shows how the OSS
619           performs for a given number of concurrently-accessed objects (files) with varying numbers
620           of I/Os in flight.</para>
621         <para>It is also useful to monitor and record average disk I/O sizes during each test using the &apos;disk io size&apos; histogram in the file <literal>/proc/fs/lustre/obdfilter/</literal> (see <xref linkend="dbdoclet.50438271_55057"/> for details). These numbers help identify problems in the system when full-sized I/Os are not submitted to the underlying disk. This may be caused by problems in the device driver or Linux block layer.</para>
622         <screen> */brw_stats</screen>
623         <para>The <literal>plot-obdfilter</literal> script included in the I/O toolkit is an example of processing output files to a .csv format and plotting a graph using <literal>gnuplot</literal>.</para>
624       </section>
625     </section>
626   </section>
627   <section xml:id="dbdoclet.50438212_85136">
628       <title><indexterm>
629         <primary>benchmarking</primary>
630         <secondary>OST I/O</secondary>
631       </indexterm>Testing OST I/O Performance (<literal>ost-survey</literal>)</title>
632     <para>The <literal>ost-survey</literal> tool is a shell script that uses <literal>lfs
633         setstripe</literal> to perform I/O against a single OST. The script writes a file (currently
634       using <literal>dd</literal>) to each OST in the Lustre file system, and compares read and
635       write speeds. The <literal>ost-survey</literal> tool is used to detect anomalies between
636       otherwise identical disk subsystems.</para>
637     <note>
638       <para>We have frequently discovered wide performance variations across all LUNs in a cluster.
639         This may be caused by faulty disks, RAID parity reconstruction during the test, or faulty
640         network hardware.</para>
641     </note>
642     <para>To run the <literal>ost-survey</literal> script, supply a file size (in KB) and the Lustre
643       file system mount point. For example, run:</para>
644     <screen>$ ./ost-survey.sh -s 10 /mnt/lustre
645 </screen>
646     <para>Typical output is:</para>
647     <screen>
648 Number of Active OST devices : 4
649 Worst  Read OST indx: 2 speed: 2835.272725
650 Best   Read OST indx: 3 speed: 2872.889668
651 Read Average: 2852.508999 +/- 16.444792 MB/s
652 Worst  Write OST indx: 3 speed: 17.705545
653 Best   Write OST indx: 2 speed: 128.172576
654 Write Average: 95.437735 +/- 45.518117 MB/s
655 Ost#  Read(MB/s)  Write(MB/s)  Read-time  Write-time
656 ----------------------------------------------------
657 0     2837.440       126.918        0.035      0.788
658 1     2864.433       108.954        0.035      0.918
659 2     2835.273       128.173        0.035      0.780
660 3     2872.890       17.706        0.035      5.648
661 </screen>
662   </section>
663   <section xml:id="mds_survey_ref">
664     <title><indexterm><primary>benchmarking</primary><secondary>MDS
665 performance</secondary></indexterm>Testing MDS Performance (<literal>mds-survey</literal>)</title>
666         <para><literal>mds-survey</literal> is available in Lustre software release 2.2 and beyond. The
667         <literal>mds-survey</literal> script tests the local metadata performance using the
668       echo_client to drive different layers of the MDS stack: mdd, mdt, osd (the Lustre software
669       only supports mdd stack). It can be used with the following classes of operations:</para>
670
671     <itemizedlist>
672       <listitem>
673         <para><literal>Open-create/mkdir/create</literal></para>
674       </listitem>
675       <listitem>
676         <para><literal>Lookup/getattr/setxattr</literal></para>
677       </listitem>
678       <listitem>
679         <para><literal>Delete/destroy</literal></para>
680       </listitem>
681       <listitem>
682         <para><literal>Unlink/rmdir</literal></para>
683       </listitem>
684     </itemizedlist>
685     <para>These operations will be run by a variable number of concurrent threads and will test with the number of directories specified by the user. The run can be executed such that all threads operate in a single directory (dir_count=1) or in private/unique directory (dir_count=x thrlo=x thrhi=x).</para>
686
687     <para>The mdd instance is driven directly. The script automatically loads the obdecho module if required and creates instance of echo_client.</para>
688
689     <para>This script can also create OST objects by providing stripe_count greater than zero.</para>
690
691     <para><emphasis role="bold">To perform a run:</emphasis></para>
692       <orderedlist>
693         <listitem>
694           <para>Start the Lustre MDT.</para>
695           <para>The Lustre MDT should be mounted on the MDS node to be tested.</para>
696         </listitem>
697         <listitem>
698           <para>Start the Lustre OSTs (optional, only required when test with OST objects)</para>
699           <para>The Lustre OSTs should be mounted on the OSS node(s).</para>
700         </listitem>
701         <listitem>
702           <para>Run the <literal>mds-survey</literal> script as explain below</para>
703           <para>The script must be customized according to the components under test and where it should keep its working files. Customization variables are described as followed:</para>
704           <itemizedlist>
705             <listitem>
706               <para><literal>thrlo</literal> - threads to start testing. skipped if less than
707                 <literal>dir_count</literal></para>
708             </listitem>
709             <listitem>
710               <para><literal>thrhi</literal> - maximum number of threads to test</para>
711             </listitem>
712             <listitem>
713               <para><literal>targets</literal> - MDT instance</para>
714             </listitem>
715             <listitem>
716               <para><literal>file_count</literal> - number of files per thread to test</para>
717             </listitem>
718             <listitem>
719               <para><literal>dir_count</literal> - total number of directories to test. Must be less
720               than or equal to <literal>thrhi</literal></para>
721             </listitem>
722             <listitem>
723               <para><literal>stripe_count </literal>- number stripe on OST objects</para>
724             </listitem>
725             <listitem>
726               <para><literal>tests_str</literal> - test operations. Must have at least "create" and
727               "destroy"</para>
728             </listitem>
729             <listitem>
730               <para><literal>start_number</literal> - base number for each thread to prevent name
731               collisions</para>
732             </listitem>
733             <listitem>
734               <para><literal>layer</literal> - MDS stack's layer to be tested</para>
735             </listitem>
736           </itemizedlist>
737           <para>Run without OST objects creation:</para>
738           <para>Setup the Lustre MDS without OST mounted. Then invoke the <literal>mds-survey</literal> script</para>
739           <screen>$ thrhi=64 file_count=200000 sh mds-survey</screen>
740           <para>Run with OST objects creation:</para>
741           <para>Setup the Lustre MDS with at least one OST mounted. Then invoke the
742             <literal>mds-survey</literal> script with <literal>stripe_count</literal>
743           parameter</para>
744           <screen>$ thrhi=64 file_count=200000 stripe_count=2 sh mds-survey</screen>
745           <para>Note: a specific MDT instance can be specified using targets variable.</para>
746           <screen>$ targets=lustre-MDT0000 thrhi=64 file_count=200000 stripe_count=2 sh mds-survey</screen>
747         </listitem>
748       </orderedlist>
749     <section remap="h3">
750       <title>Output Files</title>
751       <para>When the <literal>mds-survey</literal> script runs, it creates a number of working files and a pair of result files. All files start with the prefix defined in the variable <literal>${rslt}</literal>.</para>
752       <informaltable frame="all">
753         <tgroup cols="2">
754           <colspec colname="c1" colwidth="50*"/>
755           <colspec colname="c2" colwidth="50*"/>
756           <thead>
757             <row>
758               <entry>
759                 <para><emphasis role="bold">File</emphasis></para>
760               </entry>
761               <entry>
762                 <para><emphasis role="bold">Description</emphasis></para>
763               </entry>
764             </row>
765           </thead>
766           <tbody>
767             <row>
768               <entry>
769                 <para> <literal>${rslt}.summary</literal></para>
770               </entry>
771               <entry>
772                 <para> Same as stdout</para>
773               </entry>
774             </row>
775             <row>
776               <entry>
777                 <para> <literal>${rslt}.script_*</literal></para>
778               </entry>
779               <entry>
780                 <para> Per-host test script files</para>
781               </entry>
782             </row>
783             <row>
784               <entry>
785                 <para> <literal>${rslt}.detail_tmp*</literal></para>
786               </entry>
787               <entry>
788                 <para> Per-mdt result files</para>
789               </entry>
790             </row>
791             <row>
792               <entry>
793                 <para> <literal>${rslt}.detail</literal></para>
794               </entry>
795               <entry>
796                 <para> Collected result files for post-mortem</para>
797               </entry>
798             </row>
799           </tbody>
800         </tgroup>
801       </informaltable>
802       <para>The <literal>mds-survey</literal> script iterates over the given number of threads performing the specified tests and checks that all test processes have completed successfully.</para>
803       <note>
804       <para>The <literal>mds-survey</literal> script may not clean up properly if it is aborted or if it encounters an unrecoverable error. In this case, a manual cleanup may be required, possibly including killing any running instances of <literal>lctl</literal>, removing <literal>echo_client</literal> instances created by the script and unloading <literal>obdecho</literal>.</para>
805       </note>
806     </section>
807       <section remap="h4">
808         <title>Script Output</title>
809         <para>The <literal>.summary</literal> file and <literal>stdout</literal> of the <literal>mds-survey</literal> script contain lines like:</para>
810         <screen>mdt 1 file 100000 dir 4 thr 4 create 5652.05 [ 999.01,46940.48] destroy 5797.79 [ 0.00,52951.55] </screen>
811         <para>Where:</para>
812         <informaltable frame="all">
813           <tgroup cols="2">
814             <colspec colname="c1" colwidth="50*"/>
815             <colspec colname="c2" colwidth="50*"/>
816             <thead>
817               <row>
818                 <entry>
819                   <para><emphasis role="bold">Parameter and value</emphasis></para>
820                 </entry>
821                 <entry>
822                   <para><emphasis role="bold">Description</emphasis></para>
823                 </entry>
824               </row>
825             </thead>
826             <tbody>
827               <row>
828                 <entry>
829                   <para>mdt 1</para>
830                 </entry>
831                 <entry>
832                   <para>Total number of MDT under test</para>
833                 </entry>
834               </row>
835               <row>
836                 <entry>
837                   <para>file 100000</para>
838                 </entry>
839                 <entry>
840                   <para>Total number of files per thread to operate</para>
841                 </entry>
842               </row>
843               <row>
844                 <entry>
845                   <para>dir 4</para>
846                 </entry>
847                 <entry>
848                   <para>Total number of directories to operate</para>
849                 </entry>
850               </row>
851               <row>
852                 <entry>
853                   <para>thr 4</para>
854                 </entry>
855                 <entry>
856                   <para>Total number of threads operate over all directories</para>
857                 </entry>
858               </row>
859               <row>
860                 <entry>
861                   <para>create, destroy</para>
862                 </entry>
863                 <entry>
864                   <para>Tests name. More tests will be displayed on the same line.</para>
865                 </entry>
866               </row>
867               <row>
868                 <entry>
869                   <para>565.05</para>
870                 </entry>
871                 <entry>
872                   <para>Aggregate operations over MDT measured by dividing the total number of operations by the elapsed time.</para>
873                 </entry>
874               </row>
875               <row>
876                 <entry>
877                   <para>[999.01,46940.48]</para>
878                 </entry>
879                 <entry>
880                   <para>Minimum and maximum instantaneous operation seen on any individual MDT</para>
881                 </entry>
882               </row>
883             </tbody>
884           </tgroup>
885         </informaltable>
886         <note>
887         <para>If script output has "ERROR", this usually means there is issue during the run such as running out of space on the MDT and/or OST. More detailed debug information is available in the ${rslt}.detail file</para>
888       </note>
889       </section>
890   </section>
891   <section xml:id="dbdoclet.50438212_58201">
892     <title><indexterm><primary>benchmarking</primary><secondary>application profiling</secondary></indexterm>Collecting Application Profiling Information (<literal>stats-collect</literal>)</title>
893     <para>The <literal>stats-collect</literal> utility contains the following scripts used to collect application profiling information from Lustre clients and servers:</para>
894     <itemizedlist>
895       <listitem>
896         <para><literal>lstat.sh</literal>  - Script for a single node that is run on each profile node.</para>
897       </listitem>
898       <listitem>
899         <para><literal>gather_stats_everywhere.sh</literal>  - Script that collect statistics.</para>
900       </listitem>
901       <listitem>
902         <para><literal>config.sh</literal>  - Script that contains customized configuration descriptions.</para>
903       </listitem>
904     </itemizedlist>
905     <para>The <literal>stats-collect</literal> utility requires:</para>
906     <itemizedlist>
907       <listitem>
908         <para>Lustre software to be installed and set up on your cluster</para>
909       </listitem>
910       <listitem>
911         <para>SSH and SCP access to these nodes without requiring a password</para>
912       </listitem>
913     </itemizedlist>
914     <section remap="h3">
915       <title>Using <literal>stats-collect</literal></title>
916       <para>The stats-collect utility is configured by including profiling configuration variables in the config.sh script. Each configuration variable takes the following form, where 0 indicates statistics are to be collected only when the script starts and stops and <emphasis>n</emphasis> indicates the interval in seconds at which statistics are to be collected:</para>
917       <screen><replaceable>statistic</replaceable>_INTERVAL=<replaceable>0|n</replaceable></screen>
918       <para>Statistics that can be collected include:</para>
919       <itemizedlist>
920         <listitem>
921           <para><literal>VMSTAT</literal>  - Memory and CPU usage and aggregate read/write operations</para>
922         </listitem>
923         <listitem>
924           <para><literal>SERVICE</literal>  - Lustre OST and MDT RPC service statistics</para>
925         </listitem>
926         <listitem>
927           <para><literal>BRW</literal> - OST bulk read/write statistics (brw_stats)</para>
928         </listitem>
929         <listitem>
930           <para><literal>SDIO</literal>  - SCSI disk IO statistics (sd_iostats)</para>
931         </listitem>
932         <listitem>
933           <para><literal>MBALLOC</literal>  - <literal>ldiskfs</literal> block allocation statistics</para>
934         </listitem>
935         <listitem>
936           <para><literal>IO</literal>  - Lustre target operations statistics</para>
937         </listitem>
938         <listitem>
939           <para><literal>JBD</literal>  - ldiskfs journal statistics</para>
940         </listitem>
941         <listitem>
942           <para><literal>CLIENT</literal>  - Lustre OSC request statistics</para>
943         </listitem>
944       </itemizedlist>
945       <para>To collect profile information:</para>
946       <para>Begin collecting statistics on each node specified in the config.sh script.</para>
947       <orderedlist>
948         <listitem>
949           <para>Starting the collect profile daemon on each node by entering:</para>
950           <screen>sh gather_stats_everywhere.sh config.sh start 
951 </screen>
952         </listitem>
953         <listitem>
954           <para>Run the test.</para>
955         </listitem>
956         <listitem>
957           <para>Stop collecting statistics on each node, clean up the temporary file, and create a profiling tarball.</para>
958           <para>Enter:</para>
959           <screen>sh gather_stats_everywhere.sh config.sh stop <replaceable>log_name</replaceable>.tgz</screen>
960           <para>When <literal><replaceable>log_name</replaceable>.tgz</literal>
961             is specified, a profile tarball <literal><replaceable>/tmp/log_name</replaceable>.tgz</literal> is created.</para>
962         </listitem>
963         <listitem>
964           <para>Analyze the collected statistics and create a csv tarball for the specified profiling data.</para>
965           <screen>sh gather_stats_everywhere.sh config.sh analyse log_tarball.tgz csv
966 </screen>
967         </listitem>
968       </orderedlist>
969     </section>
970   </section>
971 </chapter>