Whamcloud - gitweb
LUDOC-394 manual: Remove extra 'held' word
[doc/manual.git] / LNetSelfTest.xml
1 <?xml version='1.0' encoding='UTF-8'?>
2 <chapter xmlns="http://docbook.org/ns/docbook"
3  xmlns:xl="http://www.w3.org/1999/xlink" version="5.0" xml:lang="en-US"
4  xml:id="lnetselftest">
5   <title xml:id="lnetselftest.title">Testing Lustre Network Performance (LNet Self-Test)</title>
6   <para><anchor xml:id="lnet_selftest_testing" xreflabel=""/>This chapter describes the LNet
7     self-test, which is used by site administrators to confirm that Lustre Networking (LNet) has
8     been properly installed and configured, and that underlying network software and hardware are
9     performing according to expectations. The chapter includes:</para>
10   <itemizedlist>
11     <listitem>
12       <para><xref linkend="overview_lnet_selftest"/></para>
13     </listitem>
14     <listitem>
15       <para><xref linkend="using_lnet_selftest"/></para>
16     </listitem>
17     <listitem>
18       <para><xref linkend="cmd_reference_lnet_selftest"/></para>
19     </listitem>
20   </itemizedlist>
21   <section xml:id="overview_lnet_selftest">
22     <title><indexterm><primary>LNet</primary><secondary>self-test</secondary></indexterm>
23 LNet Self-Test Overview</title>
24     <para>LNet self-test is a kernel module that runs over LNet and the Lustre network drivers (LNDs). It is designed to:</para>
25     <itemizedlist>
26       <listitem>
27         <para>Test the connection ability of the Lustre network</para>
28       </listitem>
29       <listitem>
30         <para>Run regression tests of the Lustre network</para>
31       </listitem>
32       <listitem>
33         <para>Test performance of the Lustre network</para>
34       </listitem>
35     </itemizedlist>
36     <para>After you have obtained performance results for your Lustre network, refer to <xref linkend="lustretuning"/> for information about parameters that can be used to tune LNet for optimum performance.</para>
37     <note>
38       <para>Apart from the performance impact, LNet self-test is invisible to the Lustre file
39         system.</para>
40     </note>
41     <para>An LNet self-test cluster includes two types of nodes:</para>
42     <itemizedlist>
43       <listitem>
44         <para><emphasis role="bold">Console node</emphasis>  - A node used to control and monitor an LNet self-test cluster. The console node serves as the user interface of the LNet self-test system and can be any node in the test cluster. All self-test commands are entered from the console node. From the console node, a user can control and monitor the status of the entire LNet self-test cluster (session). The console node is exclusive in that a user cannot control two different sessions from one console node.</para>
45       </listitem>
46       <listitem>
47         <para><emphasis role="bold">Test nodes</emphasis>  - The nodes on which the tests are run. Test nodes are controlled by the user from the console node; the user does not need to log into them directly.</para>
48       </listitem>
49     </itemizedlist>
50     <para>LNet self-test has two user utilities:</para>
51     <itemizedlist>
52       <listitem>
53         <para><emphasis role="bold">
54             <literal>lst</literal>
55           </emphasis>  - The user interface for the self-test console (run on the <emphasis>console node</emphasis>). It provides a list of commands to control the entire test system, including commands to create a session, create test groups, etc.</para>
56       </listitem>
57       <listitem>
58         <para><emphasis role="bold">
59             <literal>lstclient</literal>
60           </emphasis>  - The userspace LNet self-test program (run on a <emphasis>test node</emphasis>). The <literal>lstclient</literal> utility is linked with userspace LNDs and LNet. This utility is not needed if only kernel space LNet and LNDs are used.</para>
61       </listitem>
62     </itemizedlist>
63     <note>
64       <para><emphasis>Test nodes</emphasis> can be in either kernel or userspace. A <emphasis>console node</emphasis> can invite a kernel <emphasis>test node</emphasis> to join the session by running <literal>lst add_group NID</literal>, but the <emphasis>console node</emphasis> cannot actively add a userspace <emphasis>test node</emphasis> to the session. A <emphasis>console node</emphasis> can passively accept a <emphasis>test node</emphasis> to the session while the <emphasis>test node</emphasis> is running <literal>lstclient</literal> to connect to the <emphasis>console node</emphasis>.</para>
65     </note>
66     <section remap="h3">
67       <title>Prerequisites</title>
68       <para>To run LNet self-test, these modules must be loaded on both <emphasis>console nodes</emphasis> and <emphasis>test nodes</emphasis>:</para>
69       <itemizedlist>
70         <listitem>
71           <para><literal>libcfs</literal></para>
72         </listitem>
73         <listitem>
74           <para><literal>net</literal></para>
75         </listitem>
76         <listitem>
77           <para><literal>lnet_selftest</literal></para>
78         </listitem>
79         <listitem>
80           <para><literal>klnds</literal>: A kernel Lustre network driver (LND) (i.e, <literal>ksocklnd</literal>, <literal>ko2iblnd</literal>...) as needed by your network configuration.</para>
81         </listitem>
82       </itemizedlist>
83       <para>To load the required modules, run:</para>
84       <screen>modprobe lnet_selftest </screen>
85       <para>This command recursively loads the modules on which LNet self-test depends.</para>
86       <note>
87         <para>While the <emphasis>console node</emphasis> and <emphasis>test nodes</emphasis> require all the prerequisite modules to be loaded, userspace test nodes do not require these modules.</para>
88       </note>
89     </section>
90   </section>
91   <section xml:id="using_lnet_selftest">
92     <title>Using LNet Self-Test</title>
93     <para>This section describes how to create and run an LNet self-test. The examples shown are for a test that simulates the traffic pattern of a set of Lustre servers on a TCP network accessed by Lustre clients on an InfiniBand network connected via LNet routers. In this example, half the clients are reading and half the clients are writing.</para>
94     <section remap="h3">
95       <title>Creating a Session</title>
96       <para>A <emphasis>session</emphasis> is a set of processes that run on a <emphasis>test node</emphasis>. Only one session can be run at a time on a test node to ensure that the session has exclusive use of the node. The console node is used to create, change or destroy a session (<literal>new_session</literal>, <literal>end_session</literal>, <literal>show_session</literal>). For more about session parameters, see <xref linkend="session_cmd"/>.</para>
97       <para>Almost all operations should be performed within the context of a session. From the <emphasis>console node</emphasis>, a user can only operate nodes in his own session. If a session ends, the session context in all test nodes is stopped.</para>
98       <para>The following commands set the <literal>LST_SESSION</literal> environment variable to identify the session on the console node and create a session called <literal>read_write</literal>:</para>
99       <screen>export LST_SESSION=$$
100 lst new_session read_write</screen>
101     </section>
102     <section remap="h3">
103       <title>Setting Up Groups</title>
104       <para>A <emphasis>group</emphasis> is a named collection of nodes. Any number of groups can exist in a single LNet self-test session. Group membership is not restricted in that a <emphasis>test node</emphasis> can be included in any number of groups.</para>
105       <para>Each node in a group has a rank, determined by the order in which it was added to the group. The rank is used to establish test traffic patterns.</para>
106       <para>A user can only control nodes in his/her session. To allocate nodes to the session, the user needs to add nodes to a group (of the session). All nodes in a group can be referenced by the group name. A node can be allocated to multiple groups of a session.</para>
107       <para>In the following example, three groups are established on a console node:</para>
108       <screen>lst add_group servers 192.168.10.[8,10,12-16]@tcp
109 lst add_group readers 192.168.1.[1-253/2]@o2ib
110 lst add_group writers 192.168.1.[2-254/2]@o2ib</screen>
111       <para>These three groups include:</para>
112       <itemizedlist>
113         <listitem>
114           <para>Nodes that will function as &apos;servers&apos; to be accessed by &apos;clients&apos; during the LNet self-test session</para>
115         </listitem>
116         <listitem>
117           <para>Nodes that will function as &apos;clients&apos; that will simulate <emphasis>reading</emphasis> data from the &apos;servers&apos;</para>
118         </listitem>
119         <listitem>
120           <para>Nodes that will function as &apos;clients&apos; that will simulate <emphasis>writing</emphasis> data to the &apos;servers&apos;</para>
121         </listitem>
122       </itemizedlist>
123       <note>
124         <para>A <emphasis>console node</emphasis> can associate kernel space <emphasis>test nodes</emphasis> with the session by running <literal>lst add_group <replaceable>NIDs</replaceable></literal>, but a userspace test node cannot be actively added to the session. A console node can passively &quot;accept&quot; a test node to associate with a test session while the test node running <literal>lstclient</literal> connects to the console node, i.e: <literal>lstclient --sesid <replaceable>CONSOLE_NID</replaceable> --group <replaceable>NAME</replaceable></literal>).</para>
125       </note>
126     </section>
127     <section xml:id="running_lnet_selftest">
128       <title>Defining and Running the Tests</title>
129       <para>A <emphasis>test</emphasis> generates a network load between two groups of nodes, a
130         source group identified using the <literal>--from</literal> parameter and a target group
131         identified using the <literal>--to</literal> parameter. When a test is running, each node in
132         the <literal>--from <replaceable>group</replaceable></literal> simulates a client by sending
133         requests to nodes in the <literal>--to <replaceable>group</replaceable></literal>, which are
134         simulating a set of servers, and then receives responses in return. This activity is
135         designed to mimic Lustre file system RPC traffic.</para>
136       <para>A <emphasis>batch</emphasis> is a collection of tests that are started and stopped together and run in parallel. A test must always be run as part of a batch, even if it is just a single test. Users can only run or stop a test batch, not individual tests.</para>
137       <para>Tests in a batch are non-destructive to the file system, and can be run in a normal
138         Lustre file system environment (provided the performance impact is acceptable).</para>
139       <para>A simple batch might contain a single test, for example, to determine whether the network bandwidth presents an I/O bottleneck. In this example, the <literal>--to <replaceable>group</replaceable></literal> could be comprised of Lustre OSSs and <literal>--from <replaceable>group</replaceable></literal> the compute nodes. A second test could be added to perform pings from a login node to the MDS to see how checkpointing affects the <literal>ls -l</literal> process.</para>
140       <para>Two types of tests are available:</para>
141       <itemizedlist>
142         <listitem>
143           <para><emphasis role="bold"><literal>ping</literal> -</emphasis>  A <literal>ping</literal> generates a short request message, which results in a short response. Pings are useful to determine latency and small message overhead and to simulate Lustre metadata traffic.</para>
144         </listitem>
145         <listitem>
146           <para><emphasis role="bold"><literal>brw</literal> -</emphasis>  In a <literal>brw</literal> (&apos;bulk read write&apos;) test, data is transferred from the target to the source (<literal>brwread</literal>) or data is transferred from the source to the target (<literal>brwwrite</literal>). The size of the bulk transfer is set using the <literal>size</literal> parameter. A brw test is useful to determine network bandwidth and to simulate Lustre I/O traffic.</para>
147         </listitem>
148       </itemizedlist>
149       <para>In the example below, a batch is created called <literal>bulk_rw</literal>. Then two <literal>brw</literal> tests are added. In the first test, 1M of data is sent from the servers to the clients as a simulated read operation with a simple data validation check. In the second test, 4K of data is sent from the clients to the servers as a simulated write operation with a full data validation check.</para>
150       <screen>lst add_batch bulk_rw
151 lst add_test --batch bulk_rw --from readers --to servers \
152   brw read check=simple size=1M
153 lst add_test --batch bulk_rw --from writers --to servers \
154   brw write check=full size=4K</screen>
155       <para>The traffic pattern and test intensity is determined by several
156         properties such as test type, distribution of test nodes, concurrency
157         of test, and RDMA operation type. For more details,
158         see <xref linkend="batch_test_cmd"/>.
159       </para>
160     </section>
161     <section remap="h3">
162       <title>Sample Script</title>
163       <para>This sample LNet self-test script simulates the traffic pattern of a set of Lustre servers on a TCP network, accessed by Lustre clients on an InfiniBand network (connected via LNet routers). In this example, half the clients are reading and half the clients are writing.</para>
164       <para>Run this script on the console node:</para>
165       <screen>#!/bin/bash
166 export LST_SESSION=$$
167 lst new_session read/write
168 lst add_group servers 192.168.10.[8,10,12-16]@tcp
169 lst add_group readers 192.168.1.[1-253/2]@o2ib
170 lst add_group writers 192.168.1.[2-254/2]@o2ib
171 lst add_batch bulk_rw
172 lst add_test --batch bulk_rw --from readers --to servers \
173 brw read check=simple size=1M
174 lst add_test --batch bulk_rw --from writers --to servers \
175 brw write check=full size=4K
176 # start running
177 lst run bulk_rw
178 # display server stats for 30 seconds
179 lst stat servers &amp; sleep 30; kill $!
180 # tear down
181 lst end_session</screen>
182       <note>
183         <para>This script can be easily adapted to pass the group NIDs by shell variables or command line arguments (making it good for general-purpose use).</para>
184       </note>
185     </section>
186   </section>
187   <section xml:id="cmd_reference_lnet_selftest">
188     <title>LNet Self-Test Command Reference</title>
189     <para>The LNet self-test (<literal>lst</literal>) utility is used to issue LNet self-test commands. The <literal>lst</literal> utility takes a number of command line arguments. The first argument is the command name and subsequent arguments are command-specific.</para>
190     <section xml:id="session_cmd">
191       <title>Session Commands</title>
192       <para>This section describes <literal>lst</literal> session commands.</para>
193       <para><emphasis role="bold">
194           <literal>LST_FEATURES</literal>
195         </emphasis></para>
196         <para>The <literal>lst</literal> utility uses the <literal>LST_FEATURES</literal> environmental variable to determine what optional features should be enabled.  All features are disabled by default.  The supported values for <literal>LST_FEATURES</literal> are:</para>
197         <itemizedlist>
198           <listitem>
199             <para><emphasis role="bold"><literal>1</literal> -</emphasis>  Enable the Variable Page Size feature for LNet Selftest.</para>
200           </listitem>
201         </itemizedlist>
202         <para>Example:</para>
203         <screen>export LST_FEATURES=1</screen>
204       <para><emphasis role="bold">
205           <literal>LST_SESSION</literal>
206         </emphasis></para>
207       <para>The <literal>lst</literal> utility uses the <literal>LST_SESSION</literal> environmental variable to identify the session locally on the self-test console node. This should be a numeric value that uniquely identifies all session processes on the node. It is convenient to set this to the process ID of the shell both for interactive use and in shell scripts. Almost all <literal>lst</literal> commands require <literal>LST_SESSION</literal> to be set.</para>
208       <para>Example:</para>
209       <screen>export LST_SESSION=$$</screen>
210       <para><emphasis role="bold">
211           <literal>new_session [--timeout <replaceable>SECONDS</replaceable>] [--force] <replaceable>SESSNAME</replaceable></literal>
212         </emphasis></para>
213       <para>Creates a new session session named <replaceable>SESSNAME</replaceable>.</para>
214       <informaltable frame="all">
215         <tgroup cols="2">
216           <colspec colname="c1" colwidth="50*"/>
217           <colspec colname="c2" colwidth="50*"/>
218           <thead>
219             <row>
220               <entry>
221                 <para><emphasis role="bold">Parameter</emphasis></para>
222               </entry>
223               <entry>
224                 <para><emphasis role="bold">Description</emphasis></para>
225               </entry>
226             </row>
227           </thead>
228           <tbody>
229             <row>
230               <entry>
231                 <para><literal>--timeout <replaceable>seconds</replaceable></literal></para>
232               </entry>
233               <entry>
234                 <para>Console timeout value of the session. The session ends automatically if it remains idle (i.e., no commands are issued) for this period.</para>
235               </entry>
236             </row>
237             <row>
238               <entry>
239                 <para><literal>--force</literal></para>
240               </entry>
241               <entry>
242                 <para>Ends conflicting sessions. This determines who &apos;wins&apos; when one session conflicts with another. For example, if there is already an active session on this node, then the attempt to create a new session fails unless the <literal>--force</literal> flag is specified. If the <literal>--force</literal> flag is specified, then the active session is ended. Similarly, if a session attempts to add a node that is already &apos;owned&apos; by another session, the <literal>--force</literal> flag allows this session to &apos;steal&apos; the node.</para>
243               </entry>
244             </row>
245             <row>
246               <entry>
247                 <para><literal><replaceable>name</replaceable></literal></para>
248               </entry>
249               <entry>
250                 <para>A human-readable string to print when listing sessions or reporting session conflicts.</para>
251               </entry>
252             </row>
253           </tbody>
254         </tgroup>
255       </informaltable>
256       <para><emphasis role="bold">Example:</emphasis></para>
257       <screen>$ lst new_session --force read_write</screen>
258       <para><literal>end_session</literal></para>
259       <para>Stops all operations and tests in the current session and clears the session&apos;s status.</para>
260       <screen>$ lst end_session</screen>
261       <para><literal>show_session</literal></para>
262       <para>Shows the session information. This command prints information about the current session. It does not require LST_SESSION to be defined in the process environment.</para>
263       <screen>$ lst show_session</screen>
264     </section>
265     <section remap="h3">
266       <title>Group Commands</title>
267       <para>This section describes <literal>lst</literal> group commands.</para>
268       <para><literal>add_group <replaceable>name</replaceable> <replaceable>NIDS</replaceable> [<replaceable>NIDs</replaceable>...]</literal></para>
269       <para>Creates the group and adds a list of test nodes to the group.</para>
270       <informaltable frame="all">
271         <tgroup cols="2">
272           <colspec colname="c1" colwidth="50*"/>
273           <colspec colname="c2" colwidth="50*"/>
274           <thead>
275             <row>
276               <entry>
277                 <para><emphasis role="bold">Parameter</emphasis></para>
278               </entry>
279               <entry>
280                 <para><emphasis role="bold">Description</emphasis></para>
281               </entry>
282             </row>
283           </thead>
284           <tbody>
285             <row>
286               <entry>
287                 <para> <literal><replaceable>name</replaceable></literal></para>
288               </entry>
289               <entry>
290                 <para>Name of the group.</para>
291               </entry>
292             </row>
293             <row>
294               <entry>
295                 <para> <literal><replaceable>NIDs</replaceable></literal></para>
296               </entry>
297               <entry>
298                 <para>A string that may be expanded to include one or more LNet NIDs.</para>
299               </entry>
300             </row>
301           </tbody>
302         </tgroup>
303       </informaltable>
304       <para><emphasis role="bold">Example:</emphasis></para>
305       <screen>$ lst add_group servers 192.168.10.[35,40-45]@tcp
306 $ lst add_group clients 192.168.1.[10-100]@tcp 192.168.[2,4].\
307   [10-20]@tcp</screen>
308       <para><literal>update_group <replaceable>name</replaceable> [--refresh] [--clean <replaceable>status</replaceable>] [--remove <replaceable>NIDs</replaceable>]</literal></para>
309       <para>Updates the state of nodes in a group or adjusts a group&apos;s membership. This command is useful if some nodes have crashed and should be excluded from the group.</para>
310       <informaltable frame="all">
311         <tgroup cols="3">
312           <colspec colname="c1" colwidth="33*"/>
313           <colspec colname="c2" colwidth="33*"/>
314           <colspec colname="c3" colwidth="33*"/>
315           <thead>
316             <row>
317               <entry>
318                 <para><emphasis role="bold">Parameter</emphasis></para>
319               </entry>
320               <entry nameend="c3" namest="c2">
321                 <para><emphasis role="bold">Description</emphasis></para>
322               </entry>
323             </row>
324           </thead>
325           <tbody>
326             <row>
327               <entry>
328                 <para>
329                 <literal>--refresh</literal>
330             </para>
331               </entry>
332               <entry nameend="c3" namest="c2">
333                 <para>Refreshes the state of all inactive nodes in the group.</para>
334               </entry>
335             </row>
336             <row>
337               <entry>
338                 <para> <literal>--clean <replaceable>status</replaceable></literal></para>
339               </entry>
340               <entry nameend="c3" namest="c2">
341                 <para>Removes nodes with a specified status from the group. Status may be:</para>
342               </entry>
343             </row>
344             <row>
345               <entry>
346                 <para> </para>
347               </entry>
348               <entry>
349                 <para>active</para>
350               </entry>
351               <entry>
352                 <para>The node is in the current session.</para>
353               </entry>
354             </row>
355             <row>
356               <entry>
357                 <para> </para>
358               </entry>
359               <entry>
360                 <para>busy</para>
361               </entry>
362               <entry>
363                 <para>The node is now owned by another session.</para>
364               </entry>
365             </row>
366             <row>
367               <entry>
368                 <para> </para>
369               </entry>
370               <entry>
371                 <para>down</para>
372               </entry>
373               <entry>
374                 <para>The node has been marked down.</para>
375               </entry>
376             </row>
377             <row>
378               <entry>
379                 <para> </para>
380               </entry>
381               <entry>
382                 <para>unknown</para>
383               </entry>
384               <entry>
385                 <para>The node&apos;s status has yet to be determined.</para>
386               </entry>
387             </row>
388             <row>
389               <entry>
390                 <para> </para>
391               </entry>
392               <entry>
393                 <para>invalid</para>
394               </entry>
395               <entry>
396                 <para>Any state but active.</para>
397               </entry>
398             </row>
399             <row>
400               <entry>
401                 <para><literal>--remove <replaceable>NIDs</replaceable></literal></para>
402               </entry>
403               <entry nameend="c3" namest="c2">
404                 <para> Removes specified nodes from the group.</para>
405               </entry>
406             </row>
407           </tbody>
408         </tgroup>
409       </informaltable>
410       <para><emphasis role="bold">Example:</emphasis></para>
411       <screen>$ lst update_group clients --refresh
412 $ lst update_group clients --clean busy
413 $ lst update_group clients --clean invalid // \
414   invalid == busy || down || unknown
415 $ lst update_group clients --remove \192.168.1.[10-20]@tcp</screen>
416       <para><literal> list_group [<replaceable>name</replaceable>] [--active] [--busy] [--down] [--unknown] [--all]</literal></para>
417       <para>Prints information about a group or lists all groups in the current session if no group is specified.</para>
418       <informaltable frame="all">
419         <tgroup cols="2">
420           <colspec colname="c1" colwidth="50*"/>
421           <colspec colname="c2" colwidth="50*"/>
422           <thead>
423             <row>
424               <entry>
425                 <para><emphasis role="bold">Parameter</emphasis></para>
426               </entry>
427               <entry>
428                 <para><emphasis role="bold">Description</emphasis></para>
429               </entry>
430             </row>
431           </thead>
432           <tbody>
433             <row>
434               <entry>
435                 <para><literal><replaceable>name</replaceable></literal></para>
436               </entry>
437               <entry>
438                 <para>The name of the group.</para>
439               </entry>
440             </row>
441             <row>
442               <entry>
443                 <para>
444                 <literal>--active</literal>
445             </para>
446               </entry>
447               <entry>
448                 <para>Lists the active nodes.</para>
449               </entry>
450             </row>
451             <row>
452               <entry>
453                 <para>
454                 <literal>--busy</literal>
455             </para>
456               </entry>
457               <entry>
458                 <para>Lists the busy nodes.</para>
459               </entry>
460             </row>
461             <row>
462               <entry>
463                 <literal>--down</literal>
464               </entry>
465               <entry>
466                 <para>Lists the down nodes.</para>
467               </entry>
468             </row>
469             <row>
470               <entry>
471                 <literal>--unknown</literal>
472               </entry>
473               <entry>
474                 <para>Lists unknown nodes.</para>
475               </entry>
476             </row>
477             <row>
478               <entry>
479                 <literal>--all</literal>
480               </entry>
481               <entry>
482                 <para>Lists all nodes.</para>
483               </entry>
484             </row>
485           </tbody>
486         </tgroup>
487       </informaltable>
488       <para>Example:</para>
489       <screen>$ lst list_group
490 1) clients
491 2) servers
492 Total 2 groups
493 $ lst list_group clients
494 ACTIVE BUSY DOWN UNKNOWN TOTAL
495 3 1 2 0 6
496 $ lst list_group clients --all
497 192.168.1.10@tcp Active
498 192.168.1.11@tcp Active
499 192.168.1.12@tcp Busy
500 192.168.1.13@tcp Active
501 192.168.1.14@tcp DOWN
502 192.168.1.15@tcp DOWN
503 Total 6 nodes
504 $ lst list_group clients --busy
505 192.168.1.12@tcp Busy
506 Total 1 node</screen>
507       <para><literal>del_group <replaceable>name</replaceable></literal></para>
508       <para>Removes a group from the session. If the group is referred to by any test, then the operation fails. If nodes in the group are referred to only by this group, then they are kicked out from the current session; otherwise, they are still in the current session.</para>
509       <screen>$ lst del_group clients</screen>
510       <para><literal>lstclient --sesid <replaceable>NID</replaceable> --group <replaceable>name</replaceable> [--server_mode]</literal></para>
511       <para>Use <literal>lstclient</literal> to run the userland self-test client. The <literal>lstclient</literal> command should be executed after creating a session on the console. There are only two mandatory options for <literal>lstclient</literal>:</para>
512       <informaltable frame="all">
513         <tgroup cols="2">
514           <colspec colname="c1" colwidth="50*"/>
515           <colspec colname="c2" colwidth="50*"/>
516           <thead>
517             <row>
518               <entry>
519                 <para><emphasis role="bold">Parameter</emphasis></para>
520               </entry>
521               <entry>
522                 <para><emphasis role="bold">Description</emphasis></para>
523               </entry>
524             </row>
525           </thead>
526           <tbody>
527             <row>
528               <entry>
529                 <literal>--sesid <replaceable>NID</replaceable></literal>
530               </entry>
531               <entry>
532                 <para>The first console&apos;s NID.</para>
533               </entry>
534             </row>
535             <row>
536               <entry>
537                 <literal>--group <replaceable>name</replaceable></literal>
538               </entry>
539               <entry>
540                 <para>The test group to join.</para>
541               </entry>
542             </row>
543             <row>
544               <entry>
545                 <literal>--server_mode</literal>
546               </entry>
547               <entry>
548                 <para> When included, forces LNet to behave as a server, such as starting an acceptor if the underlying NID needs it or using privileged ports. Only root is allowed to use the <literal>--server_mode</literal> option.</para>
549               </entry>
550             </row>
551           </tbody>
552         </tgroup>
553       </informaltable>
554       <para><emphasis role="bold">Example:</emphasis></para>
555       <screen>Console $ lst new_session testsession
556 Client1 $ lstclient --sesid 192.168.1.52@tcp --group clients</screen>
557       <para><emphasis role="bold">Example:</emphasis></para>
558       <screen>Client1 $ lstclient --sesid 192.168.1.52@tcp |--group clients --server_mode</screen>
559     </section>
560     <section xml:id="batch_test_cmd">
561       <title>Batch and Test Commands</title>
562       <para>This section describes <literal>lst</literal> batch and test commands.</para>
563       <para><literal>add_batch <replaceable>name</replaceable></literal></para>
564       <para>A default batch test set named batch is created when the session is started. You can specify a batch name by using <literal>add_batch</literal>:</para>
565       <screen>$ lst add_batch bulkperf</screen>
566       <para>Creates a batch test called <literal>bulkperf</literal>.</para>
567       <screen>
568 add_test --batch <replaceable>batchname</replaceable> [--loop <replaceable>loop_count</replaceable>] [--concurrency <replaceable>active_count</replaceable>] [--distribute <replaceable>source_count</replaceable>:<replaceable>sink_count</replaceable>] \
569          --from <replaceable>group</replaceable> --to <replaceable>group</replaceable> brw|ping <replaceable>test_options</replaceable>
570         </screen>
571       <para>Adds a test to a batch. The parameters are described below.</para>
572       <informaltable frame="all">
573         <tgroup cols="3">
574           <colspec colname="c1" colwidth="33*"/>
575           <colspec colname="c2" colwidth="33*"/>
576           <colspec colname="c3" colwidth="33*"/>
577           <thead>
578             <row>
579               <entry>
580                 <para><emphasis role="bold">Parameter</emphasis></para>
581               </entry>
582               <entry nameend="c3" namest="c2">
583                 <para><emphasis role="bold">Description</emphasis></para>
584               </entry>
585             </row>
586           </thead>
587           <tbody>
588             <row>
589               <entry>
590                 <para> <literal>--batch <replaceable>batchname</replaceable></literal></para>
591               </entry>
592               <entry nameend="c3" namest="c2">
593                 <para>Names a group of tests for later execution.</para>
594               </entry>
595             </row>
596             <row>
597               <entry>
598                 <literal>--loop <replaceable>loop_count</replaceable></literal>
599               </entry>
600               <entry nameend="c3" namest="c2">
601                 <para>Number of times to run the test.</para>
602               </entry>
603             </row>
604             <row>
605               <entry>
606                 <literal>--concurrency <replaceable>active_count</replaceable></literal>
607               </entry>
608               <entry nameend="c3" namest="c2">
609                 <para>The number of requests that are active at one time.</para>
610               </entry>
611             </row>
612             <row>
613               <entry>
614                 <literal>--distribute <replaceable>source_count</replaceable>:<replaceable>sink_count</replaceable></literal>
615               </entry>
616               <entry nameend="c3" namest="c2">
617                 <para>Determines the ratio of client nodes to server nodes for the specified test. This allows you to specify a wide range of topologies, including one-to-one and all-to-all. Distribution divides the source group into subsets, which are paired with equivalent subsets from the target group so only nodes in matching subsets communicate.</para>
618               </entry>
619             </row>
620             <row>
621               <entry>
622                 <literal> --from <replaceable>group</replaceable></literal>
623               </entry>
624               <entry nameend="c3" namest="c2">
625                 <para>The source group (test client).</para>
626               </entry>
627             </row>
628             <row>
629               <entry>
630                 <literal> --to <replaceable>group</replaceable></literal>
631               </entry>
632               <entry nameend="c3" namest="c2">
633                 <para>The target group (test server).</para>
634               </entry>
635             </row>
636             <row>
637               <entry>
638                 <literal>ping</literal>
639               </entry>
640               <entry nameend="c3" namest="c2">
641                 <para>Sends a small request message, resulting in a small
642                   reply message. For more details, see
643                   <xref linkend="running_lnet_selftest"/>.
644                   <literal>ping</literal>
645                   does not have any additional options.
646                 </para>
647               </entry>
648             </row>
649             <row>
650               <entry>
651                 <literal>brw</literal>
652               </entry>
653               <entry nameend="c3" namest="c2">
654                 <para>Sends a small request message followed by a bulk data
655                   transfer, resulting in a small reply message.
656                   <xref linkend="running_lnet_selftest"/>. Options are:
657                 </para>
658               </entry>
659             </row>
660             <row>
661               <entry>
662                 <para> </para>
663               </entry>
664               <entry>
665                 <literal>read | write</literal>
666               </entry>
667               <entry>
668                 <para>Read or write. The default is read.</para>
669               </entry>
670             </row>
671             <row>
672               <entry/>
673               <entry>
674                 <literal>size=<replaceable>bytes[KM]</replaceable></literal>
675               </entry>
676               <entry>
677                 <para>I/O size in bytes, kilobytes, or Megabytes (i.e., <literal>size=1024</literal>, <literal>size=4K</literal>, <literal>size=1M</literal>). The default is 4 kilobytes.</para>
678               </entry>
679             </row>
680             <row>
681               <entry/>
682               <entry>
683                 <literal>check=full|simple </literal>
684               </entry>
685               <entry>
686                 <para>A data validation check (checksum of data). The default is that no check is done.</para>
687               </entry>
688             </row>
689           </tbody>
690         </tgroup>
691       </informaltable>
692       <para><emphasis role="bold">Examples showing use of the distribute parameter:</emphasis></para>
693       <screen>Clients: (C1, C2, C3, C4, C5, C6)
694 Server: (S1, S2, S3)
695 --distribute 1:1 (C1-&gt;S1), (C2-&gt;S2), (C3-&gt;S3), (C4-&gt;S1), (C5-&gt;S2),
696 \(C6-&gt;S3) /* -&gt; means test conversation */ --distribute 2:1 (C1,C2-&gt;S1), (C3,C4-&gt;S2), (C5,C6-&gt;S3)
697 --distribute 3:1 (C1,C2,C3-&gt;S1), (C4,C5,C6-&gt;S2), (NULL-&gt;S3)
698 --distribute 3:2 (C1,C2,C3-&gt;S1,S2), (C4,C5,C6-&gt;S3,S1)
699 --distribute 4:1 (C1,C2,C3,C4-&gt;S1), (C5,C6-&gt;S2), (NULL-&gt;S3)
700 --distribute 4:2 (C1,C2,C3,C4-&gt;S1,S2), (C5, C6-&gt;S3, S1)
701 --distribute 6:3 (C1,C2,C3,C4,C5,C6-&gt;S1,S2,S3)</screen>
702       <para>The setting <literal>--distribute 1:1</literal> is the default setting where each source node communicates with one target node.</para>
703       <para>When the setting <literal>--distribute 1: <replaceable>n</replaceable></literal> (where <literal><replaceable>n</replaceable></literal> is the size of the target group) is used, each source node communicates with every node in the target group.</para>
704       <para>Note that if there are more source nodes than target nodes, some source nodes may share the same target nodes. Also, if there are more target nodes than source nodes, some higher-ranked target nodes will be idle.</para>
705       <para><emphasis role="bold">Example showing a <literal>brw</literal> test:</emphasis></para>
706       <screen>$ lst add_group clients 192.168.1.[10-17]@tcp
707 $ lst add_group servers 192.168.10.[100-103]@tcp
708 $ lst add_batch bulkperf
709 $ lst add_test --batch bulkperf --loop 100 --concurrency 4 \
710   --distribute 4:2 --from clients brw WRITE size=16K</screen>
711       <para>In the example above, a batch test called bulkperf that will do a 16 kbyte bulk write request. In this test, two groups of four clients (sources) write to each of four servers (targets) as shown below:</para>
712       <itemizedlist>
713         <listitem>
714           <para> <literal>192.168.1.[10-13]</literal> will write to <literal>192.168.10.[100,101]</literal></para>
715         </listitem>
716         <listitem>
717           <para> <literal>192.168.1.[14-17]</literal> will write to <literal>192.168.10.[102,103]</literal></para>
718         </listitem>
719       </itemizedlist>
720       <para><emphasis role="bold">
721           <literal>list_batch [<replaceable>name</replaceable>] [--test <replaceable>index</replaceable>] [--active] [--invalid] [--server|client]</literal>
722         </emphasis></para>
723       <para>Lists batches in the current session or lists client and server nodes in a batch or a test.</para>
724       <informaltable frame="all">
725         <tgroup cols="3">
726           <colspec colname="c1" colwidth="33*"/>
727           <colspec colname="c2" colwidth="33*"/>
728           <colspec colname="c3" colwidth="33*"/>
729           <thead>
730             <row>
731               <entry>
732                 <para><emphasis role="bold">Parameter</emphasis></para>
733               </entry>
734               <entry nameend="c3" namest="c2">
735                 <para><emphasis role="bold">Description</emphasis></para>
736               </entry>
737             </row>
738           </thead>
739           <tbody>
740             <row>
741               <entry>
742                 <literal> --test <replaceable>index</replaceable></literal>
743               </entry>
744               <entry nameend="c3" namest="c2">
745                 <para>Lists tests in a batch. If no option is used, all tests in the batch are listed. If one of these options are used, only specified tests in the batch are listed:</para>
746               </entry>
747             </row>
748             <row>
749               <entry>
750                 <para> </para>
751               </entry>
752               <entry>
753                 <para><literal>active</literal></para>
754               </entry>
755               <entry>
756                 <para>Lists only active batch tests.</para>
757               </entry>
758             </row>
759             <row>
760               <entry>
761                 <para> </para>
762               </entry>
763               <entry>
764                 <para><literal>invalid</literal></para>
765               </entry>
766               <entry>
767                 <para>Lists only invalid batch tests.</para>
768               </entry>
769             </row>
770             <row>
771               <entry>
772                 <para> </para>
773               </entry>
774               <entry>
775                 <literal>server | client</literal>
776               </entry>
777               <entry>
778                 <para>Lists client and server nodes in a batch test.</para>
779               </entry>
780             </row>
781           </tbody>
782         </tgroup>
783       </informaltable>
784       <para><emphasis role="bold">Example:</emphasis></para>
785       <screen>$ lst list_batchbulkperf
786 $ lst list_batch bulkperf
787 Batch: bulkperf Tests: 1 State: Idle
788 ACTIVE BUSY DOWN UNKNOWN TOTAL
789 client 8 0 0 0 8
790 server 4 0 0 0 4
791 Test 1(brw) (loop: 100, concurrency: 4)
792 ACTIVE BUSY DOWN UNKNOWN TOTAL
793 client 8 0 0 0 8
794 server 4 0 0 0 4
795 $ lst list_batch bulkperf --server --active
796 192.168.10.100@tcp Active
797 192.168.10.101@tcp Active
798 192.168.10.102@tcp Active
799 192.168.10.103@tcp Active</screen>
800       <para><literal>
801           run
802           <replaceable>name</replaceable>
803         </literal></para>
804       <para>Runs the batch.</para>
805       <screen>$ lst run bulkperf</screen>
806       <para><literal>
807             stop
808             <replaceable>name</replaceable>
809         </literal></para>
810       <para>Stops the batch.</para>
811       <screen>$ lst stop bulkperf</screen>
812       <para><emphasis role="bold">
813           <literal>
814             query
815             <replaceable>name</replaceable>
816             [--test <replaceable>index</replaceable>] 
817             [--timeout <replaceable>seconds</replaceable>] 
818             [--loop <replaceable>loopcount</replaceable>]
819             [--delay <replaceable>seconds</replaceable>] 
820             [--all]
821           </literal>
822         </emphasis></para>
823       <para>Queries the batch status.</para>
824       <informaltable frame="all">
825         <tgroup cols="2">
826           <colspec colname="c1" colwidth="50*"/>
827           <colspec colname="c2" colwidth="50*"/>
828           <thead>
829             <row>
830               <entry>
831                 <para><emphasis role="bold">Parameter</emphasis></para>
832               </entry>
833               <entry>
834                 <para><emphasis role="bold">Description</emphasis></para>
835               </entry>
836             </row>
837           </thead>
838           <tbody>
839             <row>
840               <entry>
841                 <literal>--test <replaceable>index</replaceable></literal>
842               </entry>
843               <entry>
844                 <para>Only queries the specified test. The test index starts from 1.</para>
845               </entry>
846             </row>
847             <row>
848               <entry>
849                 <literal>--timeout <replaceable>seconds</replaceable></literal>
850               </entry>
851               <entry>
852                 <para>The timeout value to wait for RPC. The default is 5 seconds.</para>
853               </entry>
854             </row>
855             <row>
856               <entry>
857                 <literal>--loop <replaceable>#</replaceable></literal>
858               </entry>
859               <entry>
860                 <para>The loop count of the query.</para>
861               </entry>
862             </row>
863             <row>
864               <entry>
865                 <literal>--delay <replaceable>seconds</replaceable></literal>
866               </entry>
867               <entry>
868                 <para>The interval of each query. The default is 5 seconds.</para>
869               </entry>
870             </row>
871             <row>
872               <entry>
873                 <literal>--all</literal>
874               </entry>
875               <entry>
876                 <para>The list status of all nodes in a batch or a test.</para>
877               </entry>
878             </row>
879           </tbody>
880         </tgroup>
881       </informaltable>
882       <para><emphasis role="bold">Example:</emphasis></para>
883       <screen>$ lst run bulkperf
884 $ lst query bulkperf --loop 5 --delay 3
885 Batch is running
886 Batch is running
887 Batch is running
888 Batch is running
889 Batch is running
890 $ lst query bulkperf --all
891 192.168.1.10@tcp Running
892 192.168.1.11@tcp Running
893 192.168.1.12@tcp Running
894 192.168.1.13@tcp Running
895 192.168.1.14@tcp Running
896 192.168.1.15@tcp Running
897 192.168.1.16@tcp Running
898 192.168.1.17@tcp Running
899 $ lst stop bulkperf
900 $ lst query bulkperf
901 Batch is idle</screen>
902     </section>
903     <section remap="h3">
904       <title>Other Commands</title>
905       <para>This section describes other <literal>lst</literal> commands.</para>
906       <para><literal>
907             ping [-session] [--group <replaceable>name</replaceable>] 
908             [--nodes <replaceable>NIDs</replaceable>] 
909             [--batch <replaceable>name</replaceable>] 
910             [--server] 
911             [--timeout <replaceable>seconds</replaceable>]
912         </literal></para>
913       <para>Sends a &apos;hello&apos; query to the nodes.</para>
914       <informaltable frame="all">
915         <tgroup cols="2">
916           <colspec colname="c1" colwidth="50*"/>
917           <colspec colname="c2" colwidth="50*"/>
918           <thead>
919             <row>
920               <entry>
921                 <para><emphasis role="bold">Parameter</emphasis></para>
922               </entry>
923               <entry>
924                 <para><emphasis role="bold">Description</emphasis></para>
925               </entry>
926             </row>
927           </thead>
928           <tbody>
929             <row>
930               <entry>
931                 <literal>--session</literal>
932               </entry>
933               <entry>
934                 <para>Pings all nodes in the current session.</para>
935               </entry>
936             </row>
937             <row>
938               <entry>
939                 <literal>--group <replaceable>name</replaceable></literal>
940               </entry>
941               <entry>
942                 <para>Pings all nodes in a specified group.</para>
943               </entry>
944             </row>
945             <row>
946               <entry>
947                 <literal>--nodes <replaceable>NIDs</replaceable></literal>
948               </entry>
949               <entry>
950                 <para>Pings all specified nodes.</para>
951               </entry>
952             </row>
953             <row>
954               <entry>
955                 <literal>--batch <replaceable>name</replaceable></literal>
956               </entry>
957               <entry>
958                 <para>Pings all client nodes in a batch.</para>
959               </entry>
960             </row>
961             <row>
962               <entry>
963                 <literal>--server</literal>
964               </entry>
965               <entry>
966                 <para>Sends RPC to all server nodes instead of client nodes. This option is only used with <literal>--batch <replaceable>name</replaceable></literal>.</para>
967               </entry>
968             </row>
969             <row>
970               <entry>
971                 <literal> --timeout <replaceable>seconds</replaceable></literal>
972               </entry>
973               <entry>
974                 <para>The RPC timeout value.</para>
975               </entry>
976             </row>
977           </tbody>
978         </tgroup>
979       </informaltable>
980       <para><emphasis role="bold">Example:</emphasis></para>
981       <screen># lst ping 192.168.10.[15-20]@tcp
982 192.168.1.15@tcp Active [session: liang id: 192.168.1.3@tcp]
983 192.168.1.16@tcp Active [session: liang id: 192.168.1.3@tcp]
984 192.168.1.17@tcp Active [session: liang id: 192.168.1.3@tcp]
985 192.168.1.18@tcp Busy [session: Isaac id: 192.168.10.10@tcp]
986 192.168.1.19@tcp Down [session: &lt;NULL&gt; id: LNET_NID_ANY]
987 192.168.1.20@tcp Down [session: &lt;NULL&gt; id: LNET_NID_ANY]</screen>
988       <para><literal>
989             stat [--bw] [--rate] [--read] [--write] [--max] [--min] [--avg] &quot; &quot; 
990             [--timeout <replaceable>seconds</replaceable>] 
991             [--delay <replaceable>seconds</replaceable>] 
992             <replaceable>group|NIDs</replaceable>
993             [<replaceable>group|NIDs</replaceable>]
994         </literal></para>
995       <para>The collection performance and RPC statistics of one or more nodes.</para>
996       <informaltable frame="all">
997         <tgroup cols="2">
998           <colspec colname="c1" colwidth="50*"/>
999           <colspec colname="c2" colwidth="50*"/>
1000           <thead>
1001             <row>
1002               <entry>
1003                 <para><emphasis role="bold">Parameter</emphasis></para>
1004               </entry>
1005               <entry>
1006                 <para><emphasis role="bold">Description</emphasis></para>
1007               </entry>
1008             </row>
1009           </thead>
1010           <tbody>
1011             <row>
1012               <entry>
1013                 <literal>--bw</literal>
1014               </entry>
1015               <entry>
1016                 <para>Displays the bandwidth of the specified group/nodes.</para>
1017               </entry>
1018             </row>
1019             <row>
1020               <entry>
1021                 <literal>--rate</literal>
1022               </entry>
1023               <entry>
1024                 <para>Displays the rate of RPCs of the specified group/nodes.</para>
1025               </entry>
1026             </row>
1027             <row>
1028               <entry>
1029                 <literal>--read</literal>
1030               </entry>
1031               <entry>
1032                 <para>Displays the read statistics of the specified group/nodes.</para>
1033               </entry>
1034             </row>
1035             <row>
1036               <entry>
1037                 <literal>--write</literal>
1038               </entry>
1039               <entry>
1040                 <para>Displays the write statistics of the specified group/nodes.</para>
1041               </entry>
1042             </row>
1043             <row>
1044               <entry>
1045                 <literal>--max</literal>
1046               </entry>
1047               <entry>
1048                 <para>Displays the maximum value of the statistics.</para>
1049               </entry>
1050             </row>
1051             <row>
1052               <entry>
1053                 <literal>--min</literal>
1054               </entry>
1055               <entry>
1056                 <para>Displays the minimum value of the statistics.</para>
1057               </entry>
1058             </row>
1059             <row>
1060               <entry>
1061                 <literal>--avg</literal>
1062               </entry>
1063               <entry>
1064                 <para>Displays the average of the statistics.</para>
1065               </entry>
1066             </row>
1067             <row>
1068               <entry>
1069                 <literal>--timeout <replaceable>seconds</replaceable></literal>
1070               </entry>
1071               <entry>
1072                 <para>The timeout of the statistics RPC. The default is 5 seconds.</para>
1073               </entry>
1074             </row>
1075             <row>
1076               <entry>
1077                 <literal>--delay <replaceable>seconds</replaceable></literal>
1078               </entry>
1079               <entry>
1080                 <para>The interval of the statistics (in seconds).</para>
1081               </entry>
1082             </row>
1083           </tbody>
1084         </tgroup>
1085       </informaltable>
1086       <para><emphasis role="bold">Example:</emphasis></para>
1087       <screen>$ lst run bulkperf
1088 $ lst stat clients
1089 [LNet Rates of clients]
1090 [W] Avg: 1108 RPC/s Min: 1060 RPC/s Max: 1155 RPC/s
1091 [R] Avg: 2215 RPC/s Min: 2121 RPC/s Max: 2310 RPC/s
1092 [LNet Bandwidth of clients]
1093 [W] Avg: 16.60 MB/s Min: 16.10 MB/s Max: 17.1 MB/s
1094 [R] Avg: 40.49 MB/s Min: 40.30 MB/s Max: 40.68 MB/s</screen>
1095       <para>Specifying a group name (<emphasis>
1096           <literal><replaceable>group</replaceable></literal>
1097         </emphasis>) causes statistics to be gathered for all nodes in a test group. For example:</para>
1098       <screen>$ lst stat servers
1099 </screen>
1100       <para>where servers is the name of a test group created by <literal>lst add_group</literal></para>
1101       <para>Specifying a <literal><replaceable>NID</replaceable></literal> range (<literal><replaceable>NIDs</replaceable></literal>) causes statistics to be gathered for selected nodes. For example:</para>
1102       <screen>$ lst stat 192.168.0.[1-100/2]@tcp</screen>
1103       <para>Only LNet performance statistics are available. By default, all statistics
1104 information is displayed. Users can specify additional information with these options.</para>
1105       <para><literal>show_error [--session] [<replaceable>group</replaceable>|<replaceable>NIDs</replaceable>]... </literal></para>
1106       <para>Lists the number of failed RPCs on test nodes.</para>
1107       <informaltable frame="all">
1108         <tgroup cols="2">
1109           <colspec colname="c1" colwidth="50*"/>
1110           <colspec colname="c2" colwidth="50*"/>
1111           <thead>
1112             <row>
1113               <entry>
1114                 <para><emphasis role="bold">Parameter</emphasis></para>
1115               </entry>
1116               <entry>
1117                 <para><emphasis role="bold">Description</emphasis></para>
1118               </entry>
1119             </row>
1120           </thead>
1121           <tbody>
1122             <row>
1123               <entry>
1124                 <literal>--session</literal>
1125               </entry>
1126               <entry>
1127                 <para>Lists errors in the current test session. With this option, historical RPC errors are not listed.</para>
1128               </entry>
1129             </row>
1130           </tbody>
1131         </tgroup>
1132       </informaltable>
1133       <para><emphasis role="bold">Example:</emphasis></para>
1134       <screen>$ lst show_error client
1135 sclients
1136 12345-192.168.1.15@tcp: [Session: 1 brw errors, 0 ping errors] \
1137   [RPC: 20 errors, 0 dropped,
1138 12345-192.168.1.16@tcp: [Session: 0 brw errors, 0 ping errors] \
1139   [RPC: 1 errors, 0 dropped, Total 2 error nodes in clients
1140 $ lst show_error --session clients
1141 clients
1142 12345-192.168.1.15@tcp: [Session: 1 brw errors, 0 ping errors]
1143 Total 1 error nodes in clients</screen>
1144     </section>
1145   </section>
1146 </chapter>
1147 <!--
1148   vim:expandtab:shiftwidth=2:tabstop=8:
1149   -->