Whamcloud - gitweb
LUDOC-75 lnet: Add lst utility environment variable LST_FEATURES
[doc/manual.git] / BenchmarkingTests.xml
1 <?xml version='1.0' encoding='UTF-8'?>
2 <!-- This document was created with Syntext Serna Free. --><chapter xmlns="http://docbook.org/ns/docbook" xmlns:xl="http://www.w3.org/1999/xlink" version="5.0" xml:lang="en-US" xml:id="benchmarkingtests">
3   <title xml:id="benchmarkingtests.title">Benchmarking Lustre Performance (Lustre I/O Kit)</title>
4   <para>This chapter describes the Lustre I/O kit, a collection of I/O benchmarking tools for a Lustre cluster, and PIOS, a parallel I/O simulator for Linux and Solaris. It includes:</para>
5   <itemizedlist>
6     <listitem>
7       <para><xref linkend="dbdoclet.50438212_44437"/></para>
8     </listitem>
9     <listitem>
10       <para><xref linkend="dbdoclet.50438212_51053"/></para>
11     </listitem>
12     <listitem>
13       <para><xref linkend="dbdoclet.50438212_26516"/></para>
14     </listitem>
15     <listitem>
16       <para><xref linkend="dbdoclet.50438212_85136"/></para>
17     </listitem>
18     <listitem>
19       <para><xref linkend="mds_survey_ref"/></para>
20     </listitem>
21     <listitem>
22       <para><xref linkend="dbdoclet.50438212_58201"/></para>
23     </listitem>
24   </itemizedlist>
25   <section xml:id="dbdoclet.50438212_44437">
26       <title>
27           <indexterm><primary>benchmarking</primary><secondary>with Lustre I/O Kit</secondary></indexterm>
28           <indexterm><primary>profiling</primary><see>benchmarking</see></indexterm>
29           <indexterm><primary>tuning</primary><see>benchmarking</see></indexterm>
30           <indexterm><primary>performance</primary><see>benchmarking</see></indexterm>
31           
32           Using Lustre I/O Kit Tools</title>
33     <para>The tools in the Lustre I/O Kit are used to benchmark Lustre hardware and validate that it is working as expected before you install the Lustre software. It can also be used to to validate the performance of the various hardware and software layers in the cluster and also to find and troubleshoot I/O issues.</para>
34     <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>
35     <section remap="h3">
36       <title>Contents of the Lustre I/O Kit</title>
37       <para>The I/O kit contains three tests, each of which tests a progressively higher layer in the Lustre stack:</para>
38       <itemizedlist>
39         <listitem>
40           <para><literal>sgpdd_survey</literal>  - Measure basic &apos;bare metal&apos; performance of devices while bypassing the kernel block device layers, buffer cache, and file system.</para>
41         </listitem>
42         <listitem>
43           <para><literal>obdfilter_survey</literal>  - Measure the performance of one or more OSTs directly on the OSS node or alternately over the network from a Lustre client.</para>
44         </listitem>
45         <listitem>
46           <para><literal>ost_survey</literal>  - Performs I/O against OSTs individually to allow performance comparisons to detect if an OST is performing suboptimally due to hardware issues.</para>
47         </listitem>
48       </itemizedlist>
49       <para>Typically with these tests, Lustre should deliver 85-90% of the raw device performance.</para>
50       <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>
51     </section>
52     <section remap="h3">
53       <title>Preparing to Use the Lustre I/O Kit</title>
54       <para>The following prerequisites must be met to use the tests in the Lustre I/O kit:</para>
55       <itemizedlist>
56         <listitem>
57           <para>Password-free remote access to nodes in the system (provided by <literal>ssh</literal> or <literal>rsh</literal>).</para>
58         </listitem>
59         <listitem>
60           <para>LNET self-test completed to test that Lustre Networking has been properly installed and configured. See <xref linkend="lnetselftest"/>.</para>
61         </listitem>
62         <listitem>
63           <para>Lustre file system software installed.</para>
64         </listitem>
65         <listitem>
66           <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>
67         </listitem>
68       </itemizedlist>
69       <para>Download the Lustre I/O kit (<literal>lustre-iokit</literal>)from:</para>
70       <para><link xl:href="http://downloads.whamcloud.com/">http://downloads.whamcloud.com/</link></para>
71     </section>
72   </section>
73   <section xml:id="dbdoclet.50438212_51053">
74     <title><indexterm><primary>benchmarking</primary><secondary>raw hardware with sgpdd_survey</secondary></indexterm>Testing I/O Performance of Raw Hardware (<literal>sgpdd_survey</literal>)</title>
75     <para>The <literal>sgpdd_survey</literal> tool is used to test bare metal I/O performance of the raw hardware, while bypassing as much of the kernel as possible. This survey may be used to characterize the performance of a SCSI device by simulating an OST serving multiple stripe files. The data gathered by this survey can help set expectations for the performance of a Lustre OST using this device.</para>
76     <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>
77     <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>
78     <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>
79     <itemizedlist>
80       <listitem>
81         <para><emphasis>Performance is limited by the slowest disk.</emphasis></para>
82         <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>
83       </listitem>
84       <listitem>
85         <para><emphasis>Disks and arrays are very sensitive to request size.</emphasis></para>
86         <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>
87       </listitem>
88     </itemizedlist>
89     <caution>
90       <para>The <literal>sgpdd_survey</literal> script overwrites the device being tested, which results in the <emphasis>
91           <emphasis role="bold">LOSS OF ALL DATA</emphasis>
92         </emphasis> on that device. Exercise caution when selecting the device to be tested.</para>
93     </caution>
94     <note>
95       <para>Array performance with all LUNs loaded does not always match the performance of a single LUN when tested in isolation.</para>
96     </note>
97     <para><emphasis role="bold">Prequisites:</emphasis></para>
98     <itemizedlist>
99       <listitem>
100         <para><literal>sgp_dd</literal>  tool in the <literal>sg3_utils</literal> package</para>
101       </listitem>
102       <listitem>
103         <para>Lustre software is <emphasis>NOT</emphasis> required</para>
104       </listitem>
105     </itemizedlist>
106     <para>The device(s) being tested must meet one of these two requirements:</para>
107     <itemizedlist>
108       <listitem>
109         <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>
110       </listitem>
111       <listitem>
112         <para>If the device is a raw device, it must appear in the output of <literal>raw -qa</literal>.</para>
113       </listitem>
114     </itemizedlist>
115     <para>Raw and SCSI devices cannot be mixed in the test specification.</para>
116     <note>
117       <para>If you need to create raw devices to use the <literal>sgpdd_survey</literal> tool, note that raw device 0 cannot be used due to a bug in certain versions of the &quot;raw&quot; utility (including that shipped with RHEL4U4.)</para>
118     </note>
119     <section remap="h3">
120       <title><indexterm><primary>benchmarking</primary><secondary>tuning storage</secondary></indexterm>Tuning Linux Storage Devices</title>
121       <para>To get large I/O transfers (1 MB) to disk, it may be necessary to tune several kernel parameters as specified:</para>
122       <screen>/sys/block/sdN/queue/max_sectors_kb = 4096
123 /sys/block/sdN/queue/max_phys_segments = 256
124 /proc/scsi/sg/allow_dio = 1
125 /sys/module/ib_srp/parameters/srp_sg_tablesize = 255
126 /sys/block/sdN/queue/scheduler</screen>
127     </section>
128     <section remap="h3">
129       <title>Running sgpdd_survey</title>
130       <para>The <literal>sgpdd_survey</literal> script must be customized for the particular device being tested and for the location where the script saves its working and result files (by specifying the <literal>${rslt}</literal> variable). Customization variables are described at the beginning of the script.</para>
131       <para>When the <literal>sgpdd_survey</literal> script runs, it creates a number of working files and a pair of result files. The names of all the files created start with the prefixdefined in the variable <literal>${rslt}</literal>. (The default value is <literal>/tmp</literal>.) The files include:</para>
132       <itemizedlist>
133         <listitem>
134           <para>File containing standard output data (same as <literal>stdout</literal>)</para>
135           <screen>${rslt}_<emphasis>&lt;date/time&gt;</emphasis>.summary</screen>
136         </listitem>
137         <listitem>
138           <para>Temporary (tmp) files</para>
139           <screen>${rslt}_<emphasis>&lt;date/time&gt;</emphasis>_*
140 </screen>
141         </listitem>
142         <listitem>
143           <para>Collected tmp files for post-mortem</para>
144           <screen>${rslt}_<emphasis>&lt;date/time&gt;</emphasis>.detail
145 </screen>
146         </listitem>
147       </itemizedlist>
148       <para>The <literal>stdout</literal> and the <literal>.summary</literal> file will contain lines like this:</para>
149       <screen>total_size 8388608K rsz 1024 thr 1 crg 1 180.45 MB/s 1 x 180.50 \
150         = 180.50 MB/s
151 </screen>
152       <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>
153       <itemizedlist>
154         <listitem>
155           <para><literal>total_size</literal>  - Size of file being tested in KBs (8 GB in above example).</para>
156         </listitem>
157         <listitem>
158           <para><literal>rsz</literal>  - Record size in KBs (1 MB in above example).</para>
159         </listitem>
160         <listitem>
161           <para><literal>thr</literal>  - Number of threads generating I/O (1 thread in above example).</para>
162         </listitem>
163         <listitem>
164           <para><literal>crg</literal> - Current regions, the number of disjount areas on the disk to which I/O is being sent (1 region in above example, indicating that no seeking is done).</para>
165         </listitem>
166         <listitem>
167           <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>
168         </listitem>
169         <listitem>
170           <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>
171         </listitem>
172       </itemizedlist>
173       <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>
174       <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>
175     </section>
176   </section>
177   <section xml:id="dbdoclet.50438212_26516">
178     <title><indexterm><primary>benchmarking</primary><secondary>OST performance</secondary></indexterm>Testing OST Performance (<literal>obdfilter_survey</literal>)</title>
179     <para>The <literal>obdfilter_survey</literal> script generates sequential I/O from varying numbers of threads and objects (files) to simulate the I/O patterns of a Lustre client.</para>
180     <para>The <literal>obdfilter_survey</literal> script can be run directly on the OSS node to measure the OST storage performance without any intervening network, or it can be run remotely on a Lustre client to measure the OST performance including network overhead.</para>
181     <para>The <literal>obdfilter_survey</literal> is used to characterize the performance of the following:</para>
182     <itemizedlist>
183       <listitem>
184         <para><emphasis role="bold">Local file system</emphasis>  - In this mode, the <literal>obdfilter_survey</literal> script exercises one or more instances of the obdfilter directly. The script may run on one or more OSS nodes, for example, when the OSSs are all attached to the same multi-ported disk subsystem.</para>
185         <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>
186         <para>To run the test against only specific OSTs, run the script using the <literal>target=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>
187         <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>
188         <para>For more details, see <xref linkend="dbdoclet.50438212_59319"/>.</para>
189       </listitem>
190       <listitem>
191         <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>
192         <para>Pass the parameters <literal>case=network</literal> and <literal>target=<replaceable>&lt;hostname</replaceable>|<replaceable>IP_of_server&gt;</replaceable></literal> to the script. For each network case, the script does the required setup.</para>
193         <para>For more details, see <xref linkend="dbdoclet.50438212_36037"/></para>
194       </listitem>
195       <listitem>
196         <para><emphasis role="bold">Remote file system over the network</emphasis>  - In this mode the <literal>obdfilter_survey</literal> script generates I/O from a Lustre client to a remote OSS to write the data to the file system.</para>
197         <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>
198         <para>For more details, see <xref linkend="dbdoclet.50438212_62662"/>.</para>
199       </listitem>
200     </itemizedlist>
201     <caution>
202       <para>The <literal>obdfilter_survey</literal> script is destructive and should not be run on devices that containing existing data that needs to be preserved. Thus, tests using <literal>obdfilter_survey</literal> should be run before the Lustre file system is placed in production.</para>
203     </caution>
204     <note>
205       <para>If the <literal>obdfilter_survey</literal> test is terminated before it completes, some small amount of space is leaked. you can either ignore it or reformat the file system.</para>
206     </note>
207     <note>
208       <para>The <literal>obdfilter_survey</literal> script is <emphasis>NOT</emphasis> scalable beyond tens of OSTs since it is only intended to measure the I/O performance of individual storage subsystems, not the scalability of the entire system.</para>
209     </note>
210     <note>
211       <para>The <literal>obdfilter_survey</literal> script must be customized, depending on the components under test and where the script&apos;s working files should be kept. Customization variables are described at the beginning of the <literal>obdfilter_survey</literal> script. In particular, pay attention to the listed maximum values listed for each parameter in the script.</para>
212     </note>
213     <section xml:id="dbdoclet.50438212_59319">
214       <title><indexterm><primary>benchmarking</primary><secondary>local disk</secondary></indexterm>Testing Local Disk Performance</title>
215       <para>The <literal>obdfilter_survey</literal> script can be run automatically or manually against a local disk. This script profiles the overall throughput of storage hardware, including the file system and RAID layers managing the storage, by sending workloads to the OSTs that vary in thread count, object count, and I/O size.</para>
216       <para>When the <literal>obdfilter_survey</literal> script is run, it provides information about the performance abilities of the storage hardware and shows the saturation points.</para>
217       <para>The <literal>plot-obdfilter</literal> script generates from the output of the <literal>obdfilter_survey</literal> a CSV file and parameters for importing into a spreadsheet or gnuplot to visualize the data.</para>
218       <para>To run the <literal>obdfilter_survey</literal> script, create a standard Lustre configuration; no special setup is needed.</para>
219       <para><emphasis role="bold">To perform an automatic run:</emphasis></para>
220       <orderedlist>
221         <listitem>
222           <para>Start the Lustre OSTs.</para>
223           <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>
224         </listitem>
225         <listitem>
226           <para>Verify that the obdecho module is loaded. Run:</para>
227           <screen>modprobe obdecho</screen>
228         </listitem>
229         <listitem>
230           <para>Run the <literal>obdfilter_survey</literal> script with the parameter <literal>case=disk</literal>.</para>
231           <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>
232           <screen>$ nobjhi=2 thrhi=2 size=1024 case=disk sh obdfilter-survey</screen>
233         </listitem>
234       </orderedlist>
235       <para><emphasis role="italic">To perform a manual run:</emphasis></para>
236       <orderedlist>
237         <listitem>
238           <para>Start the Lustre OSTs.</para>
239           <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>
240         </listitem>
241         <listitem>
242           <para>Verify that the <literal>obdecho</literal> module is loaded. Run:</para>
243           <screen>modprobe obdecho</screen>
244         </listitem>
245         <listitem>
246           <para>Determine the OST names.</para>
247           <para>On the OSS nodes to be tested, run the lctldl command. The OST device names are listed in the fourth column of the output. For example:</para>
248           <screen>$ lctl dl |grep obdfilter
249 0 UP obdfilter lustre-OST0001 lustre-OST0001_UUID 1159
250 2 UP obdfilter lustre-OST0002 lustre-OST0002_UUID 1159
251 ...</screen>
252         </listitem>
253         <listitem>
254           <para>List all OSTs you want to test.</para>
255           <para>Use the <literal>target=parameter</literal> to list the OSTs separated by spaces. List the individual OSTs by name using the format <emphasis>
256               <literal>&lt;fsname&gt;-&lt;OSTnumber&gt;</literal>
257             </emphasis> (for example, lustre-OST0001). You do not have to specify an MDS or LOV.</para>
258         </listitem>
259         <listitem>
260           <para>Run the <literal>obdfilter_survey</literal> script with the <literal>target=parameter</literal>.</para>
261           <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>
262           <screen>$ nobjhi=2 thrhi=2 size=1024 targets=&quot;lustre-OST0001 \
263            lustre-OST0002&quot; sh obdfilter-survey</screen>
264         </listitem>
265       </orderedlist>
266     </section>
267     <section xml:id="dbdoclet.50438212_36037">
268       <title><indexterm><primary>benchmarking</primary><secondary>network</secondary></indexterm>Testing Network Performance</title>
269       <para>The <literal>obdfilter_survey</literal> script can only be run automatically against a network; no manual test is provided.</para>
270       <para>To run the network test, a specific Lustre setup is needed. Make sure that these configuration requirements have been met.</para>
271       <para><emphasis role="bold">To perform an automatic run:</emphasis></para>
272       <orderedlist>
273         <listitem>
274           <para>Start the Lustre OSTs.</para>
275           <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>
276         </listitem>
277         <listitem>
278           <para>Verify that the <literal>obdecho</literal> module is loaded. Run:</para>
279           <screen>modprobe obdecho</screen>
280         </listitem>
281         <listitem>
282           <para>Start <literal>lctl</literal> and check the device list, which must be empty. Run:</para>
283           <screen>lctl dl</screen>
284         </listitem>
285         <listitem>
286           <para>Run the <literal>obdfilter_survey</literal> script with the parameters <literal>case=network</literal> and <literal>targets=<replaceable>&lt;hostname</replaceable>|<replaceable>ip_of_server&gt;</replaceable></literal>. For example:</para>
287           <screen>$ nobjhi=2 thrhi=2 size=1024 targets=&quot;oss0 oss1&quot; \
288            case=network sh odbfilter-survey</screen>
289         </listitem>
290         <listitem>
291           <para>On the server side, view the statistics at:</para>
292           <screen>/proc/fs/lustre/obdecho/<emphasis>&lt;echo_srv&gt;</emphasis>/stats</screen>
293           <para>where <emphasis>
294               <literal>&lt;echo_srv&gt;</literal>
295             </emphasis> is the <literal>obdecho</literal> server created by the script.</para>
296         </listitem>
297       </orderedlist>
298     </section>
299     <section xml:id="dbdoclet.50438212_62662">
300       <title><indexterm><primary>benchmarking</primary><secondary>remote disk</secondary></indexterm>Testing Remote Disk Performance</title>
301       <para>The <literal>obdfilter_survey</literal> script can be run automatically or manually against a network disk. To run the network disk test, start with a standard Lustre configuration. No special setup is needed.</para>
302       <para><emphasis role="bold">To perform an automatic run:</emphasis></para>
303       <orderedlist>
304         <listitem>
305           <para>Start the Lustre OSTs.</para>
306           <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>
307         </listitem>
308         <listitem>
309           <para>Verify that the <literal>obdecho</literal> module is loaded. Run:</para>
310           <screen>modprobe obdecho</screen>
311         </listitem>
312         <listitem>
313           <para>Run the <literal>obdfilter_survey</literal> script with the parameter <literal>case=netdisk</literal>. For example:</para>
314           <screen>$ nobjhi=2 thrhi=2 size=1024 case=netdisk sh obdfilter-survey
315 </screen>
316         </listitem>
317       </orderedlist>
318       <para><emphasis role="bold">To perform a manual run:</emphasis></para>
319       <orderedlist>
320         <listitem>
321           <para>Start the Lustre OSTs.</para>
322           <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>
323         </listitem>
324         <listitem>
325           <para>Verify that the <literal>obdecho</literal> module is loaded. Run:</para>
326           <para>modprobe obdecho</para>
327         </listitem>
328         <listitem>
329           <para>Determine the OSC names.</para>
330           <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>
331           <screen>$ lctl dl |grep obdfilter
332 3 UP osc lustre-OST0000-osc-ffff88007754bc00 \
333            54b91eab-0ea9-1516-b571-5e6df349592e 5
334 4 UP osc lustre-OST0001-osc-ffff88007754bc00 \
335            54b91eab-0ea9-1516-b571-5e6df349592e 5
336 ...
337 </screen>
338         </listitem>
339         <listitem>
340           <para>List all OSCs you want to test.</para>
341           <para>Use the <literal>target=parameter</literal> to list the OSCs separated by spaces. List the individual OSCs by name seperated by spaces using the format <literal><replaceable>&lt;fsname&gt;-&lt;OST_name&gt;</replaceable>-osc-<replaceable>&lt;OSC_number&gt;</replaceable></literal> (for example, <literal>lustre-OST0000-osc-ffff88007754bc00</literal>). You <replaceable role="bold">do not have to specify an MDS or LOV.</replaceable></para>
342         </listitem>
343         <listitem>
344           <para>Run the <literal><replaceable role="bold">o</replaceable>bdfilter_survey</literal> script with the <literal>target=parameter</literal> and <literal>case=netdisk</literal>.</para>
345           <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>
346           <screen>$ nobjhi=2 thrhi=2 size=1024 \
347            targets=&quot;lustre-OST0000-osc-ffff88007754bc00 \
348            lustre-OST0001-osc-ffff88007754bc00&quot; sh obdfilter-survey
349 </screen>
350         </listitem>
351       </orderedlist>
352     </section>
353     <section remap="h3">
354       <title>Output Files</title>
355       <para>When the <literal>obdfilter_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>
356       <informaltable frame="all">
357         <tgroup cols="2">
358           <colspec colname="c1" colwidth="50*"/>
359           <colspec colname="c2" colwidth="50*"/>
360           <thead>
361             <row>
362               <entry>
363                 <para><emphasis role="bold">File</emphasis></para>
364               </entry>
365               <entry>
366                 <para><emphasis role="bold">Description</emphasis></para>
367               </entry>
368             </row>
369           </thead>
370           <tbody>
371             <row>
372               <entry>
373                 <para> <literal>${rslt}.summary</literal></para>
374               </entry>
375               <entry>
376                 <para> Same as stdout</para>
377               </entry>
378             </row>
379             <row>
380               <entry>
381                 <para> <literal>${rslt}.script_*</literal></para>
382               </entry>
383               <entry>
384                 <para> Per-host test script files</para>
385               </entry>
386             </row>
387             <row>
388               <entry>
389                 <para> <literal>${rslt}.detail_tmp*</literal></para>
390               </entry>
391               <entry>
392                 <para> Per-OST result files</para>
393               </entry>
394             </row>
395             <row>
396               <entry>
397                 <para> <literal>${rslt}.detail</literal></para>
398               </entry>
399               <entry>
400                 <para> Collected result files for post-mortem</para>
401               </entry>
402             </row>
403           </tbody>
404         </tgroup>
405       </informaltable>
406       <para>The <literal>obdfilter_survey</literal> script iterates over the given number of threads and objects performing the specified tests and checks that all test processes have completed successfully.</para>
407       <note>
408         <para>The <literal>obdfilter_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> (local or remote), removing <literal>echo_client</literal> instances created by the script and unloading <literal>obdecho</literal>.</para>
409       </note>
410       <section remap="h4">
411         <title>Script Output</title>
412         <para>The <literal>.summary</literal> file and <literal>stdout</literal> of the <literal>obdfilter_survey</literal> script contain lines like:</para>
413         <screen>ost 8 sz 67108864K rsz 1024 obj 8 thr 8 write 613.54 [ 64.00, 82.00]
414 </screen>
415         <para>Where:</para>
416         <informaltable frame="all">
417           <tgroup cols="2">
418             <colspec colname="c1" colwidth="50*"/>
419             <colspec colname="c2" colwidth="50*"/>
420             <thead>
421               <row>
422                 <entry>
423                   <para><emphasis role="bold">Parameter and value</emphasis></para>
424                 </entry>
425                 <entry>
426                   <para><emphasis role="bold">Description</emphasis></para>
427                 </entry>
428               </row>
429             </thead>
430             <tbody>
431               <row>
432                 <entry>
433                   <para> ost 8</para>
434                 </entry>
435                 <entry>
436                   <para> Total number of OSTs being tested.</para>
437                 </entry>
438               </row>
439               <row>
440                 <entry>
441                   <para> sz 67108864K</para>
442                 </entry>
443                 <entry>
444                   <para> Total amount of data read or written (in KB).</para>
445                 </entry>
446               </row>
447               <row>
448                 <entry>
449                   <para> rsz 1024</para>
450                 </entry>
451                 <entry>
452                   <para> Record size (size of each echo_client I/O, in KB).</para>
453                 </entry>
454               </row>
455               <row>
456                 <entry>
457                   <para> obj 8</para>
458                 </entry>
459                 <entry>
460                   <para> Total number of objects over all OSTs.</para>
461                 </entry>
462               </row>
463               <row>
464                 <entry>
465                   <para> thr 8</para>
466                 </entry>
467                 <entry>
468                   <para> Total number of threads over all OSTs and objects.</para>
469                 </entry>
470               </row>
471               <row>
472                 <entry>
473                   <para> write</para>
474                 </entry>
475                 <entry>
476                   <para> Test name. If more tests have been specified, they all appear on the same line.</para>
477                 </entry>
478               </row>
479               <row>
480                 <entry>
481                   <para> 613.54</para>
482                 </entry>
483                 <entry>
484                   <para> Aggregate bandwidth over all OSTs (measured by dividing the total number of MB by the elapsed time).</para>
485                 </entry>
486               </row>
487               <row>
488                 <entry>
489                   <para> [64, 82.00]</para>
490                 </entry>
491                 <entry>
492                   <para> Minimum and maximum instantaneous bandwidths on an individual OST.</para>
493                 </entry>
494               </row>
495             </tbody>
496           </tgroup>
497         </informaltable>
498         <note>
499           <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>
500         </note>
501       </section>
502       <section remap="h4">
503         <title>Visualizing Results</title>
504         <para>It is useful to import the <literal>obdfilter_survey</literal> script summary data (it is fixed width) into Excel (or any graphing package) and graph the bandwidth versus the number of threads for varying numbers of concurrent regions. This shows how the OSS performs for a given number of concurrently-accessed objects (files) with varying numbers of I/Os in flight.</para>
505         <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>
506         <screen> */brw_stats</screen>
507         <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>
508       </section>
509     </section>
510   </section>
511   <section xml:id="dbdoclet.50438212_85136">
512       <title><indexterm><primary>benchmarking</primary><secondary>OST I/O</secondary></indexterm>Testing OST I/O Performance (<literal>ost_survey</literal>)</title>
513     <para>The <literal>ost_survey</literal> tool is a shell script that uses <literal>lfs setstripe</literal> to perform I/O against a single OST. The script writes a file (currently using <literal>dd</literal>) to each OST in the Lustre file system, and compares read and write speeds. The <literal>ost_survey</literal> tool is used to detect anomalies between otherwise identical disk subsystems.</para>
514     <note>
515       <para>We have frequently discovered wide performance variations across all LUNs in a cluster. This may be caused by faulty disks, RAID parity reconstruction during the test, or faulty network hardware.</para>
516     </note>
517     <para>To run the <literal>ost_survey</literal> script, supply a file size (in KB) and the Lustre mount point. For example, run:</para>
518     <screen>$ ./ost-survey.sh 10 /mnt/lustre
519 </screen>
520     <para>Typical output is:</para>
521     <screen>
522 Average read Speed:                  6.73
523 Average write Speed:                 5.41
524 read - Worst OST indx 0              5.84 MB/s
525 write - Worst OST indx 0             3.77 MB/s
526 read - Best OST indx 1               7.38 MB/s
527 write - Best OST indx 1              6.31 MB/s
528 3 OST devices found
529 Ost index 0 Read speed               5.84         Write speed     3.77
530 Ost index 0 Read time                0.17         Write time      0.27
531 Ost index 1 Read speed               7.38         Write speed     6.31
532 Ost index 1 Read time                0.14         Write time      0.16
533 Ost index 2 Read speed               6.98         Write speed     6.16
534 Ost index 2 Read time                0.14         Write time      0.16 
535 </screen>
536   </section>
537   <section xml:id="mds_survey_ref">
538     <title><indexterm><primary>benchmarking</primary><secondary>MDS
539 performance</secondary></indexterm>Testing MDS Performance (<literal>mds-survey</literal>)</title>
540     <para>The <literal>mds-survey</literal> script tests the local metadata
541 performance using the echo_client to drive different layers of the MDS stack:
542 mdd, mdt, osd (current lustre version only supports mdd stack). It can be used with the following classes of operations:</para>
543     <itemizedlist>
544       <listitem>
545         <para><literal>Open-create/mkdir/create</literal></para>
546       </listitem>
547       <listitem>
548         <para><literal>Lookup/getattr/setxattr</literal></para>
549       </listitem>
550       <listitem>
551         <para><literal>Delete/destroy</literal></para>
552       </listitem>
553       <listitem>
554         <para><literal>Unlink/rmdir</literal></para>
555       </listitem>
556     </itemizedlist>
557     <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>
558
559     <para>The mdd instance is driven directly. The script automatically loads the obdecho module if required and creates instance of echo_client.</para>
560
561     <para>This script can also create OST objects by providing stripe_count greater than zero.</para>
562
563     <para><emphasis role="bold">To perform a run:</emphasis></para>
564       <orderedlist>
565         <listitem>
566           <para>Start the Lustre MDT.</para>
567           <para>The Lustre MDT should be mounted on the MDS node to be tested.</para>
568         </listitem>
569         <listitem>
570           <para>Start the Lustre OSTs (optional, only required when test with OST objects)</para>
571           <para>The Lustre OSTs should be mounted on the OSS node(s).</para>
572         </listitem>
573         <listitem>
574           <para>Run the <literal>mds-survey</literal> script as explain below</para>
575           <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>
576           <itemizedlist>
577             <listitem>
578               <para>thrlo - threads to start testing. skipped if less than dir_count</para>
579             </listitem>
580             <listitem>
581               <para>thrhi - maximum number of threads to test</para>
582             </listitem>
583             <listitem>
584               <para>targets - MDT instance</para>
585             </listitem>
586             <listitem>
587               <para>file_count - number of files per thread to test</para>
588             </listitem>
589             <listitem>
590               <para>dir_count - total number of directories to test. Must be less than thrhi</para>
591             </listitem>
592             <listitem>
593               <para>stripe_count - number stripe on OST objects</para>
594             </listitem>
595             <listitem>
596               <para>tests_str - test operations. Must have at least "create" and "destroy"</para>
597             </listitem>
598             <listitem>
599               <para>start_number - base number for each thread to prevent name collisions</para>
600             </listitem>
601             <listitem>
602               <para>layer - MDS stack's layer to be tested</para>
603             </listitem>
604           </itemizedlist>
605           <para>Run without OST objects creation:</para>
606           <para>Setup the Lustre MDS without OST mounted. Then invoke the <literal>mds-survey</literal> script</para>
607           <screen>$ thrhi=64 file_count=200000 sh mds-survey</screen>
608           <para>Run with OST objects creation:</para>
609           <para>Setup the Lustre MDS with at least one OST mounted. Then invoke the <literal>mds-survey</literal> script with stripe_count parameter</para>
610           <screen>$ thrhi=64 file_count=200000 stripe_count=2 sh mds-survey</screen>
611           <para>Note: a specific mdt instance can be specified using targets variable.</para>
612           <screen>$ targets=lustre-MDT0000 thrhi=64 file_count=200000 stripe_count=2 sh mds-survey</screen>
613         </listitem>
614       </orderedlist>
615     <section remap="h3">
616       <title>Output Files</title>
617       <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>
618       <informaltable frame="all">
619         <tgroup cols="2">
620           <colspec colname="c1" colwidth="50*"/>
621           <colspec colname="c2" colwidth="50*"/>
622           <thead>
623             <row>
624               <entry>
625                 <para><emphasis role="bold">File</emphasis></para>
626               </entry>
627               <entry>
628                 <para><emphasis role="bold">Description</emphasis></para>
629               </entry>
630             </row>
631           </thead>
632           <tbody>
633             <row>
634               <entry>
635                 <para> <literal>${rslt}.summary</literal></para>
636               </entry>
637               <entry>
638                 <para> Same as stdout</para>
639               </entry>
640             </row>
641             <row>
642               <entry>
643                 <para> <literal>${rslt}.script_*</literal></para>
644               </entry>
645               <entry>
646                 <para> Per-host test script files</para>
647               </entry>
648             </row>
649             <row>
650               <entry>
651                 <para> <literal>${rslt}.detail_tmp*</literal></para>
652               </entry>
653               <entry>
654                 <para> Per-mdt result files</para>
655               </entry>
656             </row>
657             <row>
658               <entry>
659                 <para> <literal>${rslt}.detail</literal></para>
660               </entry>
661               <entry>
662                 <para> Collected result files for post-mortem</para>
663               </entry>
664             </row>
665           </tbody>
666         </tgroup>
667       </informaltable>
668       <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>
669       <note>
670       <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>
671       </note>
672     </section>
673       <section remap="h4">
674         <title>Script Output</title>
675         <para>The <literal>.summary</literal> file and <literal>stdout</literal> of the <literal>mds-survey</literal> script contain lines like:</para>
676         <screen>mdt 1 file 100000 dir 4 thr 4 create 5652.05 [ 999.01,46940.48] destroy 5797.79 [ 0.00,52951.55] </screen>
677         <para>Where:</para>
678         <informaltable frame="all">
679           <tgroup cols="2">
680             <colspec colname="c1" colwidth="50*"/>
681             <colspec colname="c2" colwidth="50*"/>
682             <thead>
683               <row>
684                 <entry>
685                   <para><emphasis role="bold">Parameter and value</emphasis></para>
686                 </entry>
687                 <entry>
688                   <para><emphasis role="bold">Description</emphasis></para>
689                 </entry>
690               </row>
691             </thead>
692             <tbody>
693               <row>
694                 <entry>
695                   <para>mdt 1</para>
696                 </entry>
697                 <entry>
698                   <para>Total number of MDT under test</para>
699                 </entry>
700               </row>
701               <row>
702                 <entry>
703                   <para>file 100000</para>
704                 </entry>
705                 <entry>
706                   <para>Total number of files per thread to operate</para>
707                 </entry>
708               </row>
709               <row>
710                 <entry>
711                   <para>dir 4</para>
712                 </entry>
713                 <entry>
714                   <para>Total number of directories to operate</para>
715                 </entry>
716               </row>
717               <row>
718                 <entry>
719                   <para>thr 4</para>
720                 </entry>
721                 <entry>
722                   <para>Total number of threads operate over all directories</para>
723                 </entry>
724               </row>
725               <row>
726                 <entry>
727                   <para>create, destroy</para>
728                 </entry>
729                 <entry>
730                   <para>Tests name. More tests will be displayed on the same line.</para>
731                 </entry>
732               </row>
733               <row>
734                 <entry>
735                   <para>565.05</para>
736                 </entry>
737                 <entry>
738                   <para>Aggregate operations over MDT measured by dividing the total number of operations by the elapsed time.</para>
739                 </entry>
740               </row>
741               <row>
742                 <entry>
743                   <para>[999.01,46940.48]</para>
744                 </entry>
745                 <entry>
746                   <para>Minimum and maximum instantaneous operation seen on any individual MDT</para>
747                 </entry>
748               </row>
749             </tbody>
750           </tgroup>
751         </informaltable>
752         <note>
753         <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>
754       </note>
755       </section>
756   </section>
757   <section xml:id="dbdoclet.50438212_58201">
758     <title><indexterm><primary>benchmarking</primary><secondary>application profiling</secondary></indexterm>Collecting Application Profiling Information (<literal>stats-collect</literal>)</title>
759     <para>The <literal>stats-collect</literal> utility contains the following scripts used to collect application profiling information from Lustre clients and servers:</para>
760     <itemizedlist>
761       <listitem>
762         <para><literal>lstat.sh</literal>  - Script for a single node that is run on each profile node.</para>
763       </listitem>
764       <listitem>
765         <para><literal>gather_stats_everywhere.sh</literal>  - Script that collect statistics.</para>
766       </listitem>
767       <listitem>
768         <para><literal>config.sh</literal>  - Script that contains customized configuration descriptions.</para>
769       </listitem>
770     </itemizedlist>
771     <para>The <literal>stats-collect</literal> utility requires:</para>
772     <itemizedlist>
773       <listitem>
774         <para>Lustre to be installed and set up on your cluster</para>
775       </listitem>
776       <listitem>
777         <para>SSH and SCP access to these nodes without requiring a password</para>
778       </listitem>
779     </itemizedlist>
780     <section remap="h3">
781       <title>Using <literal>stats-collect</literal></title>
782       <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>
783       <screen><emphasis>&lt;statistic&gt;</emphasis>_INTERVAL=<emphasis>[</emphasis>0<emphasis>|n]</emphasis></screen>
784       <para>Statistics that can be collected include:</para>
785       <itemizedlist>
786         <listitem>
787           <para><literal>VMSTAT</literal>  - Memory and CPU usage and aggregate read/write operations</para>
788         </listitem>
789         <listitem>
790           <para><literal>SERVICE</literal>  - Lustre OST and MDT RPC service statistics</para>
791         </listitem>
792         <listitem>
793           <para><literal>BRW</literal>  - OST block read/write statistics (brw_stats)</para>
794         </listitem>
795         <listitem>
796           <para><literal>SDIO</literal>  - SCSI disk IO statistics (sd_iostats)</para>
797         </listitem>
798         <listitem>
799           <para><literal>MBALLOC</literal>  - <literal>ldiskfs</literal> block allocation statistics</para>
800         </listitem>
801         <listitem>
802           <para><literal>IO</literal>  - Lustre target operations statistics</para>
803         </listitem>
804         <listitem>
805           <para><literal>JBD</literal>  - ldisfs journal statistics</para>
806         </listitem>
807         <listitem>
808           <para><literal>CLIENT</literal>  - Lustre OSC request statistics</para>
809         </listitem>
810       </itemizedlist>
811       <para>To collect profile information:</para>
812       <para>Begin collecting statistics on each node specified in the config.sh script.</para>
813       <orderedlist>
814         <listitem>
815           <para>Starting the collect profile daemon on each node by entering:</para>
816           <screen>sh gather_stats_everywhere.sh config.sh start 
817 </screen>
818         </listitem>
819         <listitem>
820           <para>Run the test.</para>
821         </listitem>
822         <listitem>
823           <para>Stop collecting statistics on each node, clean up the temporary file, and create a profiling tarball.</para>
824           <para>Enter:</para>
825           <screen>sh gather_stats_everywhere.sh config.sh stop <emphasis>&lt;log_name.tgz&gt;</emphasis></screen>
826           <para>When <emphasis>
827               <literal>&lt;log_name.tgz&gt;</literal>
828             </emphasis> is specified, a profile tarball <literal>/tmp/<replaceable>&lt;log_name.tgz&gt;</replaceable></literal> is created.</para>
829         </listitem>
830         <listitem>
831           <para>Analyze the collected statistics and create a csv tarball for the specified profiling data.</para>
832           <screen>sh gather_stats_everywhere.sh config.sh analyse log_tarball.tgz csv
833 </screen>
834         </listitem>
835       </orderedlist>
836     </section>
837   </section>
838 </chapter>