Whamcloud - gitweb
LUDOC-11 Misc cleanups of examples and text
[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="dbdoclet.50438212_58201"/></para>
20     </listitem>
21   </itemizedlist>
22   <section xml:id="dbdoclet.50438212_44437">
23       <title>
24           <indexterm><primary>benchmarking</primary><secondary>with Lustre I/O Kit</secondary></indexterm>
25           <indexterm><primary>profiling</primary><see>benchmarking</see></indexterm>
26           <indexterm><primary>tuning</primary><see>benchmarking</see></indexterm>
27           <indexterm><primary>performance</primary><see>benchmarking</see></indexterm>
28           
29           Using Lustre I/O Kit Tools</title>
30     <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>
31     <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>
32     <section remap="h3">
33       <title>Contents of the Lustre I/O Kit</title>
34       <para>The I/O kit contains three tests, each of which tests a progressively higher layer in the Lustre stack:</para>
35       <itemizedlist>
36         <listitem>
37           <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>
38         </listitem>
39         <listitem>
40           <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>
41         </listitem>
42         <listitem>
43           <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>
44         </listitem>
45       </itemizedlist>
46       <para>Typically with these tests, Lustre should deliver 85-90% of the raw device performance.</para>
47       <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>
48     </section>
49     <section remap="h3">
50       <title>Preparing to Use the Lustre I/O Kit</title>
51       <para>The following prerequisites must be met to use the tests in the Lustre I/O kit:</para>
52       <itemizedlist>
53         <listitem>
54           <para>Password-free remote access to nodes in the system (provided by <literal>ssh</literal> or <literal>rsh</literal>).</para>
55         </listitem>
56         <listitem>
57           <para>LNET self-test completed to test that Lustre Networking has been properly installed and configured. See <xref linkend="lnetselftest"/>.</para>
58         </listitem>
59         <listitem>
60           <para>Lustre file system software installed.</para>
61         </listitem>
62         <listitem>
63           <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>
64         </listitem>
65       </itemizedlist>
66       <para>Download the Lustre I/O kit (<literal>lustre-iokit</literal>)from:</para>
67       <para><link xl:href="http://downloads.whamcloud.com/">http://downloads.whamcloud.com/</link></para>
68     </section>
69   </section>
70   <section xml:id="dbdoclet.50438212_51053">
71     <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>
72     <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>
73     <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>
74     <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>
75     <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>
76     <itemizedlist>
77       <listitem>
78         <para><emphasis>Performance is limited by the slowest disk.</emphasis></para>
79         <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>
80       </listitem>
81       <listitem>
82         <para><emphasis>Disks and arrays are very sensitive to request size.</emphasis></para>
83         <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>
84       </listitem>
85     </itemizedlist>
86     <caution>
87       <para>The <literal>sgpdd_survey</literal> script overwrites the device being tested, which results in the <emphasis>
88           <emphasis role="bold">LOSS OF ALL DATA</emphasis>
89         </emphasis> on that device. Exercise caution when selecting the device to be tested.</para>
90     </caution>
91     <note>
92       <para>Array performance with all LUNs loaded does not always match the performance of a single LUN when tested in isolation.</para>
93     </note>
94     <para><emphasis role="bold">Prequisites:</emphasis></para>
95     <itemizedlist>
96       <listitem>
97         <para><literal>sgp_dd</literal>  tool in the <literal>sg3_utils</literal> package</para>
98       </listitem>
99       <listitem>
100         <para>Lustre software is <emphasis>NOT</emphasis> required</para>
101       </listitem>
102     </itemizedlist>
103     <para>The device(s) being tested must meet one of these two requirements:</para>
104     <itemizedlist>
105       <listitem>
106         <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>
107       </listitem>
108       <listitem>
109         <para>If the device is a raw device, it must appear in the output of <literal>raw -qa</literal>.</para>
110       </listitem>
111     </itemizedlist>
112     <para>Raw and SCSI devices cannot be mixed in the test specification.</para>
113     <note>
114       <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>
115     </note>
116     <section remap="h3">
117       <title><indexterm><primary>benchmarking</primary><secondary>tuning storage</secondary></indexterm>Tuning Linux Storage Devices</title>
118       <para>To get large I/O transfers (1 MB) to disk, it may be necessary to tune several kernel parameters as specified:</para>
119       <screen>/sys/block/sdN/queue/max_sectors_kb = 4096
120 /sys/block/sdN/queue/max_phys_segments = 256
121 /proc/scsi/sg/allow_dio = 1
122 /sys/module/ib_srp/parameters/srp_sg_tablesize = 255
123 /sys/block/sdN/queue/scheduler</screen>
124     </section>
125     <section remap="h3">
126       <title>Running sgpdd_survey</title>
127       <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>
128       <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>
129       <itemizedlist>
130         <listitem>
131           <para>File containing standard output data (same as <literal>stdout</literal>)</para>
132           <screen>${rslt}_<emphasis>&lt;date/time&gt;</emphasis>.summary</screen>
133         </listitem>
134         <listitem>
135           <para>Temporary (tmp) files</para>
136           <screen>${rslt}_<emphasis>&lt;date/time&gt;</emphasis>_*
137 </screen>
138         </listitem>
139         <listitem>
140           <para>Collected tmp files for post-mortem</para>
141           <screen>${rslt}_<emphasis>&lt;date/time&gt;</emphasis>.detail
142 </screen>
143         </listitem>
144       </itemizedlist>
145       <para>The <literal>stdout</literal> and the <literal>.summary</literal> file will contain lines like this:</para>
146       <screen>total_size 8388608K rsz 1024 thr 1 crg 1 180.45 MB/s 1 x 180.50 \
147         = 180.50 MB/s
148 </screen>
149       <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>
150       <itemizedlist>
151         <listitem>
152           <para><literal>total_size</literal>  - Size of file being tested in KBs (8 GB in above example).</para>
153         </listitem>
154         <listitem>
155           <para><literal>rsz</literal>  - Record size in KBs (1 MB in above example).</para>
156         </listitem>
157         <listitem>
158           <para><literal>thr</literal>  - Number of threads generating I/O (1 thread in above example).</para>
159         </listitem>
160         <listitem>
161           <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>
162         </listitem>
163         <listitem>
164           <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>
165         </listitem>
166         <listitem>
167           <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>
168         </listitem>
169       </itemizedlist>
170       <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>
171       <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>
172     </section>
173   </section>
174   <section xml:id="dbdoclet.50438212_26516">
175     <title><indexterm><primary>benchmarking</primary><secondary>OST performance</secondary></indexterm>Testing OST Performance (<literal>obdfilter_survey</literal>)</title>
176     <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>
177     <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>
178     <para>The <literal>obdfilter_survey</literal> is used to characterize the performance of the following:</para>
179     <itemizedlist>
180       <listitem>
181         <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>
182         <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>
183         <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>
184         <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>
185         <para>For more details, see <xref linkend="dbdoclet.50438212_59319"/>.</para>
186       </listitem>
187       <listitem>
188         <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>
189         <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>
190         <para>For more details, see <xref linkend="dbdoclet.50438212_36037"/></para>
191       </listitem>
192       <listitem>
193         <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>
194         <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>
195         <para>For more details, see <xref linkend="dbdoclet.50438212_62662"/>.</para>
196       </listitem>
197     </itemizedlist>
198     <caution>
199       <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>
200     </caution>
201     <note>
202       <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>
203     </note>
204     <note>
205       <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>
206     </note>
207     <note>
208       <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>
209     </note>
210     <section xml:id="dbdoclet.50438212_59319">
211       <title><indexterm><primary>benchmarking</primary><secondary>local disk</secondary></indexterm>Testing Local Disk Performance</title>
212       <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>
213       <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>
214       <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>
215       <para>To run the <literal>obdfilter_survey</literal> script, create a standard Lustre configuration; no special setup is needed.</para>
216       <para><emphasis role="bold">To perform an automatic run:</emphasis></para>
217       <orderedlist>
218         <listitem>
219           <para>Start the Lustre OSTs.</para>
220           <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>
221         </listitem>
222         <listitem>
223           <para>Verify that the obdecho module is loaded. Run:</para>
224           <screen>modprobe obdecho</screen>
225         </listitem>
226         <listitem>
227           <para>Run the <literal>obdfilter_survey</literal> script with the parameter <literal>case=disk</literal>.</para>
228           <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>
229           <screen>$ nobjhi=2 thrhi=2 size=1024 case=disk sh obdfilter-survey</screen>
230         </listitem>
231       </orderedlist>
232       <para><emphasis role="italic">To perform a manual run:</emphasis></para>
233       <orderedlist>
234         <listitem>
235           <para>Start the Lustre OSTs.</para>
236           <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>
237         </listitem>
238         <listitem>
239           <para>Verify that the <literal>obdecho</literal> module is loaded. Run:</para>
240           <screen>modprobe obdecho</screen>
241         </listitem>
242         <listitem>
243           <para>Determine the OST names.</para>
244           <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>
245           <screen>$ lctl dl |grep obdfilter
246 0 UP obdfilter lustre-OST0001 lustre-OST0001_UUID 1159
247 2 UP obdfilter lustre-OST0002 lustre-OST0002_UUID 1159
248 ...</screen>
249         </listitem>
250         <listitem>
251           <para>List all OSTs you want to test.</para>
252           <para>Use the <literal>target=parameter</literal> to list the OSTs separated by spaces. List the individual OSTs by name using the format <emphasis>
253               <literal>&lt;fsname&gt;-&lt;OSTnumber&gt;</literal>
254             </emphasis> (for example, lustre-OST0001). You do not have to specify an MDS or LOV.</para>
255         </listitem>
256         <listitem>
257           <para>Run the <literal>obdfilter_survey</literal> script with the <literal>target=parameter</literal>.</para>
258           <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>
259           <screen>$ nobjhi=2 thrhi=2 size=1024 targets=&quot;lustre-OST0001 \
260            lustre-OST0002&quot; sh obdfilter-survey</screen>
261         </listitem>
262       </orderedlist>
263     </section>
264     <section xml:id="dbdoclet.50438212_36037">
265       <title><indexterm><primary>benchmarking</primary><secondary>network</secondary></indexterm>Testing Network Performance</title>
266       <para>The <literal>obdfilter_survey</literal> script can only be run automatically against a network; no manual test is provided.</para>
267       <para>To run the network test, a specific Lustre setup is needed. Make sure that these configuration requirements have been met.</para>
268       <para><emphasis role="bold">To perform an automatic run:</emphasis></para>
269       <orderedlist>
270         <listitem>
271           <para>Start the Lustre OSTs.</para>
272           <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>
273         </listitem>
274         <listitem>
275           <para>Verify that the <literal>obdecho</literal> module is loaded. Run:</para>
276           <screen>modprobe obdecho</screen>
277         </listitem>
278         <listitem>
279           <para>Start <literal>lctl</literal> and check the device list, which must be empty. Run:</para>
280           <screen>lctl dl</screen>
281         </listitem>
282         <listitem>
283           <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>
284           <screen>$ nobjhi=2 thrhi=2 size=1024 targets=&quot;oss0 oss1&quot; \
285            case=network sh odbfilter-survey</screen>
286         </listitem>
287         <listitem>
288           <para>On the server side, view the statistics at:</para>
289           <screen>/proc/fs/lustre/obdecho/<emphasis>&lt;echo_srv&gt;</emphasis>/stats</screen>
290           <para>where <emphasis>
291               <literal>&lt;echo_srv&gt;</literal>
292             </emphasis> is the <literal>obdecho</literal> server created by the script.</para>
293         </listitem>
294       </orderedlist>
295     </section>
296     <section xml:id="dbdoclet.50438212_62662">
297       <title><indexterm><primary>benchmarking</primary><secondary>remote disk</secondary></indexterm>Testing Remote Disk Performance</title>
298       <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>
299       <para><emphasis role="bold">To perform an automatic run:</emphasis></para>
300       <orderedlist>
301         <listitem>
302           <para>Start the Lustre OSTs.</para>
303           <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>
304         </listitem>
305         <listitem>
306           <para>Verify that the <literal>obdecho</literal> module is loaded. Run:</para>
307           <screen>modprobe obdecho</screen>
308         </listitem>
309         <listitem>
310           <para>Run the <literal>obdfilter_survey</literal> script with the parameter <literal>case=netdisk</literal>. For example:</para>
311           <screen>$ nobjhi=2 thrhi=2 size=1024 case=netdisk sh obdfilter-survey
312 </screen>
313         </listitem>
314       </orderedlist>
315       <para><emphasis role="bold">To perform a manual run:</emphasis></para>
316       <orderedlist>
317         <listitem>
318           <para>Start the Lustre OSTs.</para>
319           <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>
320         </listitem>
321         <listitem>
322           <para>Verify that the <literal>obdecho</literal> module is loaded. Run:</para>
323           <para>modprobe obdecho</para>
324         </listitem>
325         <listitem>
326           <para>Determine the OSC names.</para>
327           <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>
328           <screen>$ lctl dl |grep obdfilter
329 3 UP osc lustre-OST0000-osc-ffff88007754bc00 \
330            54b91eab-0ea9-1516-b571-5e6df349592e 5
331 4 UP osc lustre-OST0001-osc-ffff88007754bc00 \
332            54b91eab-0ea9-1516-b571-5e6df349592e 5
333 ...
334 </screen>
335         </listitem>
336         <listitem>
337           <para>List all OSCs you want to test.</para>
338           <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>
339         </listitem>
340         <listitem>
341           <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>
342           <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>
343           <screen>$ nobjhi=2 thrhi=2 size=1024 \
344            targets=&quot;lustre-OST0000-osc-ffff88007754bc00 \
345            lustre-OST0001-osc-ffff88007754bc00&quot; sh obdfilter-survey
346 </screen>
347         </listitem>
348       </orderedlist>
349     </section>
350     <section remap="h3">
351       <title>Output Files</title>
352       <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>
353       <informaltable frame="all">
354         <tgroup cols="2">
355           <colspec colname="c1" colwidth="50*"/>
356           <colspec colname="c2" colwidth="50*"/>
357           <thead>
358             <row>
359               <entry>
360                 <para><emphasis role="bold">File</emphasis></para>
361               </entry>
362               <entry>
363                 <para><emphasis role="bold">Description</emphasis></para>
364               </entry>
365             </row>
366           </thead>
367           <tbody>
368             <row>
369               <entry>
370                 <para> <literal>${rslt}.summary</literal></para>
371               </entry>
372               <entry>
373                 <para> Same as stdout</para>
374               </entry>
375             </row>
376             <row>
377               <entry>
378                 <para> <literal>${rslt}.script_*</literal></para>
379               </entry>
380               <entry>
381                 <para> Per-host test script files</para>
382               </entry>
383             </row>
384             <row>
385               <entry>
386                 <para> <literal>${rslt}.detail_tmp*</literal></para>
387               </entry>
388               <entry>
389                 <para> Per-OST result files</para>
390               </entry>
391             </row>
392             <row>
393               <entry>
394                 <para> <literal>${rslt}.detail</literal></para>
395               </entry>
396               <entry>
397                 <para> Collected result files for post-mortem</para>
398               </entry>
399             </row>
400           </tbody>
401         </tgroup>
402       </informaltable>
403       <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>
404       <note>
405         <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>
406       </note>
407       <section remap="h4">
408         <title>Script Output</title>
409         <para>The <literal>.summary</literal> file and <literal>stdout</literal> of the <literal>obdfilter_survey</literal> script contain lines like:</para>
410         <screen>ost 8 sz 67108864K rsz 1024 obj 8 thr 8 write 613.54 [ 64.00, 82.00]
411 </screen>
412         <para>Where:</para>
413         <informaltable frame="all">
414           <tgroup cols="2">
415             <colspec colname="c1" colwidth="50*"/>
416             <colspec colname="c2" colwidth="50*"/>
417             <thead>
418               <row>
419                 <entry>
420                   <para><emphasis role="bold">Parameter and value</emphasis></para>
421                 </entry>
422                 <entry>
423                   <para><emphasis role="bold">Description</emphasis></para>
424                 </entry>
425               </row>
426             </thead>
427             <tbody>
428               <row>
429                 <entry>
430                   <para> ost 8</para>
431                 </entry>
432                 <entry>
433                   <para> Total number of OSTs being tested.</para>
434                 </entry>
435               </row>
436               <row>
437                 <entry>
438                   <para> sz 67108864K</para>
439                 </entry>
440                 <entry>
441                   <para> Total amount of data read or written (in KB).</para>
442                 </entry>
443               </row>
444               <row>
445                 <entry>
446                   <para> rsz 1024</para>
447                 </entry>
448                 <entry>
449                   <para> Record size (size of each echo_client I/O, in KB).</para>
450                 </entry>
451               </row>
452               <row>
453                 <entry>
454                   <para> obj 8</para>
455                 </entry>
456                 <entry>
457                   <para> Total number of objects over all OSTs.</para>
458                 </entry>
459               </row>
460               <row>
461                 <entry>
462                   <para> thr 8</para>
463                 </entry>
464                 <entry>
465                   <para> Total number of threads over all OSTs and objects.</para>
466                 </entry>
467               </row>
468               <row>
469                 <entry>
470                   <para> write</para>
471                 </entry>
472                 <entry>
473                   <para> Test name. If more tests have been specified, they all appear on the same line.</para>
474                 </entry>
475               </row>
476               <row>
477                 <entry>
478                   <para> 613.54</para>
479                 </entry>
480                 <entry>
481                   <para> Aggregate bandwidth over all OSTs (measured by dividing the total number of MB by the elapsed time).</para>
482                 </entry>
483               </row>
484               <row>
485                 <entry>
486                   <para> [64, 82.00]</para>
487                 </entry>
488                 <entry>
489                   <para> Minimum and maximum instantaneous bandwidths on an individual OST.</para>
490                 </entry>
491               </row>
492             </tbody>
493           </tgroup>
494         </informaltable>
495         <note>
496           <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>
497         </note>
498       </section>
499       <section remap="h4">
500         <title>Visualizing Results</title>
501         <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>
502         <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>
503         <screen> */brw_stats</screen>
504         <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>
505       </section>
506     </section>
507   </section>
508   <section xml:id="dbdoclet.50438212_85136">
509       <title><indexterm><primary>benchmarking</primary><secondary>OST I/O</secondary></indexterm>Testing OST I/O Performance (<literal>ost_survey</literal>)</title>
510     <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>
511     <note>
512       <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>
513     </note>
514     <para>To run the <literal>ost_survey</literal> script, supply a file size (in KB) and the Lustre mount point. For example, run:</para>
515     <screen>$ ./ost-survey.sh 10 /mnt/lustre
516 </screen>
517     <para>Typical output is:</para>
518     <screen>
519 Average read Speed:                  6.73
520 Average write Speed:                 5.41
521 read - Worst OST indx 0              5.84 MB/s
522 write - Worst OST indx 0             3.77 MB/s
523 read - Best OST indx 1               7.38 MB/s
524 write - Best OST indx 1              6.31 MB/s
525 3 OST devices found
526 Ost index 0 Read speed               5.84         Write speed     3.77
527 Ost index 0 Read time                0.17         Write time      0.27
528 Ost index 1 Read speed               7.38         Write speed     6.31
529 Ost index 1 Read time                0.14         Write time      0.16
530 Ost index 2 Read speed               6.98         Write speed     6.16
531 Ost index 2 Read time                0.14         Write time      0.16 
532 </screen>
533   </section>
534   <section xml:id="dbdoclet.50438212_58201">
535     <title><indexterm><primary>benchmarking</primary><secondary>application profiling</secondary></indexterm>Collecting Application Profiling Information (<literal>stats-collect</literal>)</title>
536     <para>The <literal>stats-collect</literal> utility contains the following scripts used to collect application profiling information from Lustre clients and servers:</para>
537     <itemizedlist>
538       <listitem>
539         <para><literal>lstat.sh</literal>  - Script for a single node that is run on each profile node.</para>
540       </listitem>
541       <listitem>
542         <para><literal>gather_stats_everywhere.sh</literal>  - Script that collect statistics.</para>
543       </listitem>
544       <listitem>
545         <para><literal>config.sh</literal>  - Script that contains customized configuration descriptions.</para>
546       </listitem>
547     </itemizedlist>
548     <para>The <literal>stats-collect</literal> utility requires:</para>
549     <itemizedlist>
550       <listitem>
551         <para>Lustre to be installed and set up on your cluster</para>
552       </listitem>
553       <listitem>
554         <para>SSH and SCP access to these nodes without requiring a password</para>
555       </listitem>
556     </itemizedlist>
557     <section remap="h3">
558       <title>Using <literal>stats-collect</literal></title>
559       <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>
560       <screen><emphasis>&lt;statistic&gt;</emphasis>_INTERVAL=<emphasis>[</emphasis>0<emphasis>|n]</emphasis></screen>
561       <para>Statistics that can be collected include:</para>
562       <itemizedlist>
563         <listitem>
564           <para><literal>VMSTAT</literal>  - Memory and CPU usage and aggregate read/write operations</para>
565         </listitem>
566         <listitem>
567           <para><literal>SERVICE</literal>  - Lustre OST and MDT RPC service statistics</para>
568         </listitem>
569         <listitem>
570           <para><literal>BRW</literal>  - OST block read/write statistics (brw_stats)</para>
571         </listitem>
572         <listitem>
573           <para><literal>SDIO</literal>  - SCSI disk IO statistics (sd_iostats)</para>
574         </listitem>
575         <listitem>
576           <para><literal>MBALLOC</literal>  - <literal>ldiskfs</literal> block allocation statistics</para>
577         </listitem>
578         <listitem>
579           <para><literal>IO</literal>  - Lustre target operations statistics</para>
580         </listitem>
581         <listitem>
582           <para><literal>JBD</literal>  - ldisfs journal statistics</para>
583         </listitem>
584         <listitem>
585           <para><literal>CLIENT</literal>  - Lustre OSC request statistics</para>
586         </listitem>
587       </itemizedlist>
588       <para>To collect profile information:</para>
589       <para>Begin collecting statistics on each node specified in the config.sh script.</para>
590       <orderedlist>
591         <listitem>
592           <para>Starting the collect profile daemon on each node by entering:</para>
593           <screen>sh gather_stats_everywhere.sh config.sh start 
594 </screen>
595         </listitem>
596         <listitem>
597           <para>Run the test.</para>
598         </listitem>
599         <listitem>
600           <para>Stop collecting statistics on each node, clean up the temporary file, and create a profiling tarball.</para>
601           <para>Enter:</para>
602           <screen>sh gather_stats_everywhere.sh config.sh stop <emphasis>&lt;log_name.tgz&gt;</emphasis></screen>
603           <para>When <emphasis>
604               <literal>&lt;log_name.tgz&gt;</literal>
605             </emphasis> is specified, a profile tarball <literal>/tmp/<replaceable>&lt;log_name.tgz&gt;</replaceable></literal> is created.</para>
606         </listitem>
607         <listitem>
608           <para>Analyze the collected statistics and create a csv tarball for the specified profiling data.</para>
609           <screen>sh gather_stats_everywhere.sh config.sh analyse log_tarball.tgz csv
610 </screen>
611         </listitem>
612       </orderedlist>
613     </section>
614   </section>
615 </chapter>