1 Release 1.0 - January 2003
3 ***********************************
4 * Performance Test Overview *
5 ***********************************
7 This directory contains performance tests for measuring round-trip
8 latency statistics of ACE synchronous messaging using unmarshalled
11 In terms of protocol and service type, three different tests are
14 * TCP over SOCK_STREAM
15 * SCTP over SOCK_STREAM
16 * SCTP over SOCK_SEQPACK
18 All three of these tests share the same architecture, which is
19 described in the following section.
21 ***************************
23 ***************************
25 As mentioned above, the performance tests measure round-trip latency
26 statistics. We are talking about the round trip between two service
27 endpoints, a client and a server. The client sends the server an
28 arbitrary message with a specific length---up to 2^16 bytes---and the
29 server responds with a 2-byte reply. The client measures and records
30 the time it takes to complete this exchange. The whole test is then
31 repeated through many iterations, and finally the client outputs the
36 1. The server program is started first. It creates a passive-mode
37 socket and runs an infinite loop waiting for clients to connect.
39 2. The client program is started next. It may be configured with
40 numerous parameters, which include:
42 * the hostname and port where the server's passive-mode socket
44 * the desired message length, which may be any power of two
46 * the desired number of iterations (by default 1 million)
48 3. The client connects to the server's passive-mode socket. If all
49 goes well, the client and server will each obtain a data-mode
50 socket that serves as a communication endpoint.
52 4. The client sends an initial header message containing the intended
53 number of iterations and the message length (which will be
54 the same for each iteration). Armed with this information, the
55 server spawns a separate thread to handle these iterations.
57 5. The client creates an in-memory data structure that serves as a
58 histogram. The histogram is configured with a range of possible
59 round-trip latencies, and this range is divided into a number of
60 "bins". The latency measured for each test entry will either
61 fall into one of these "bins", or it will fall outside the entire
62 range and will be logged as an outlier.
64 6. The client and server repeat the following interaction for each
67 a. The client starts a stopwatch.
69 b. The client sends the server an arbitrary message of the
72 c. After receiving this entire message from the client, the
73 server sends the client a 2-byte reply.
75 d. After receiving the 2-byte reply from the server, the client
78 e. The round-trip latency, as measureed by the stopwatch, is
79 logged to the in-memory histogram.
81 7. After all these iterations are complete, the client disconnects
82 from the server. The client then takes the in-memory histogram
83 and dumps its text representation to STDOUT.
85 8. The client exits. The server thread dedicated to this client
86 exits. The main thread of the server continues to run an infinite
87 loop waiting for more clients to connect to the passive-mode
90 **************************
92 **************************
94 You must use a different pair of client and server executables
95 depending on whether you desire to use the SOCK_STREAM service or the
98 The SOCK_STREAM client and server are called SOCK_STREAM_clt and
99 SOCK_STREAM_srv, respectively. The SOCK_SEQPACK client and server are
100 called SOCK_SEQPACK_clt and SOCK_SEQPACK_srv, respectively.
102 Each of these executables uses SCTP as its default protocol. As an
103 extra feature, SOCK_STREAM_clt and SOCK_STREAM_srv offer TCP as an
104 alternate protocol. The choice between TCP and SCTP is exposed via
105 the '-t' option. (Individual instances of SOCK_STREAM_clt and
106 SOCK_STREAM_srv must use the same protocol in order to connect and
109 Any of the four executables will show usage information if you run it
110 with the '-h' option. For instance, here is the usage message
111 produced by SOCK_STREAM_clt:
113 ./SOCK_STREAM_clt - Measures round trip latency statistics of ACE synchronous
114 messaging (SOCK_Stream) using unmarshalled ACE_CDR::Octet.
115 USAGE: ./SOCK_STREAM_clt [ -<flag> [<val>] | --<name> [<val>] ]...
117 Flag Args Option-Name Default
118 -c int test-iterations 1000000
119 -n none test-enable-nagle NO NAGLING
120 -t str (sctp|tcp) test-transport-protocol sctp
122 -m dbl histogram-min-bin 0
123 -M dbl histogram-max-bin 10000
124 -x int histogram-num-outliers 100
125 -b int histogram-bin-count 1000
127 -C int client-port assigned by kernel
128 -i str client-connect-addr INADDR_ANY
130 -p int server-port 45453
131 -H str server-host localhost
133 -s int (0-16) payload-size-power-of-2 <MUST SET VALUE>
137 For each option, the long "Option-Name" may be prefixed by two dashes
138 and used on the command line in place of the shorter "Flag". Hence
140 ./SOCK_STREAM_clt -s 5
144 ./SOCK_STREAM_clt --payload-size-power-of-2 5
146 The options shown above for SOCK_STREAM_clt (and the similar options
147 available for SOCK_SEQPACK_clt) are discussed in the next section.
149 *****************************
150 * Client-Side Options *
151 *****************************
153 The following options are available for both SOCK_STREAM_clt and
156 test-iterations [ -c int ]
158 the number of times to repeat the round-trip-latency test
159 loop. The default is 1000000.
161 test-enable-nagle [ -n ]
163 Enable Nagle's algorithm (which is disabled by default).
165 histogram-min-bin [ -m double ]
167 the lower boundary on the range of the histogram.
168 The default is 0. The unit of measurement is the millisecond.
170 histogram-max-bin [ -M double ]
172 the upper boundary on the range of the histogram.
173 The default is 10000. The unit of measurement is the
176 histogram-num-outliers [ -x int ]
178 the maximum number of outliers to maintain in the histogram.
181 histogram-bin-count [ -b int ]
183 the number of histogram bins. The default is 1000. The width
186 (histogram-max-bin - histogram-min-bin) / histogram-bin-count
188 client-port [ -C int ]
189 client-connect-addr [ -i string ]
191 the port and network address where the client's data-mode
192 socket is to be bound. By default, the port number is
193 assigned by the kernel, and the socket is bound to all network
196 server-port [ -p int ]
197 server-host [ -H string ]
199 the port and hostname where the server's passive-mode socket
200 is bound. The default port is 45453 and the default host is
203 payload-size-power-of-2 [ -s int ]
205 an integer X. The size of the payload will be 2^X bytes.
211 The following option is available only for SOCK_STREAM_clt:
213 test-transport-protocol [ -t (sctp|tcp) ]
215 the protocol for the test. The default is sctp.
217 In contrast, SOCK_SEQPACK_clt always uses SCTP as its protocol.
219 *****************************
220 * Server-Side Options *
221 *****************************
223 The following options are available for both SOCK_STREAM_srv and
226 test-enable-nagle [ -n ]
228 Enable Nagle's algorithm (which is disabled by default).
230 server-port [ -p int ]
232 the port where the server's passive-mode socket will be
233 bound. The default is 45453.
239 The following option is available for both SOCK_STREAM_srv and
240 SOCK_SEQPACK_srv, but the latter offers additional functionality:
242 server-accept-addr [ -a w.x.y.z ] (for SOCK_STREAM_srv)
243 [ -a w.x.y.z,a.b.c.d,... ] (for SOCK_SEQPACK_srv)
245 the network address (or addresses) to which the server's
246 passive-mode socket will be bound.
248 The default value of INADDR_ANY should be sufficient for
249 machines that have only one network interface.
251 If your machine has two interfaces, and you wish to bind the
252 socket only to one of these, then you may explicitly specify
253 the desired interface with an expression such as
254 "-a 192.168.221.104" or "-a 192.168.1.43".
256 If your machine has three or more interfaces, and you wish to
257 bind the socket only to a subset of two or more, AND you are
258 using SOCK_SEQPACK_srv, THEN you may explicitly specify the
259 desired interface with an expression such as
260 "-a 192.168.221.104,192.168.1.43". The argument here is a
261 comma-delimited list of dotted-decimal IPv4 addresses with no
262 whitespace interspersed. This level of control is not
263 possible with SOCK_STREAM_srv.
265 The following option is available only for SOCK_STREAM_srv:
267 test-transport-protocol [ -t (sctp|tcp) ]
269 the protocol for the test. The default is sctp.
271 In contrast, SOCK_SEQPACK_srv always uses SCTP as its protocol.
273 ***************************
274 * Test Walk-Through *
275 ***************************
277 This section shows a walk-through of a typical scenario using
278 SOCK_STREAM_clt and SOCK_STREAM_srv to run an SCTP performance test.
280 You can run the equivalent TCP performance test by adding "-t tcp" to
281 the command line of both programs. Alternately, you can run a
282 SOCK_SEQPACK-based SCTP performance test by substituting
283 SOCK_SEQPACK_clt and SOCK_SEQPACK_srv for SOCK_STREAM_clt and
284 SOCK_STREAM_srv, respectively.
286 In this scenario, both client and server run on the same machine. We
287 use a message size of 2^7 bytes and a relatively small number of
288 iterations, 1000, in order to make the test go quickly. The server's
289 passive-mode socket binds to the default port, 45453, which is also
290 the default port expected by the client. We invoke no other special
293 For clarity, we envision starting the client and server in two
296 The steps of the walk-through are as follows:
301 (12761|1024) Accepting connections on port 45453
302 on interface INADDR_ANY using IPPROTO_SCTP
303 (12761|1024) starting server at port 45453
304 (12761|1024) select timed out
305 (12761|1024) select timed out
306 (12761|1024) select timed out
307 (12761|1024) select timed out
310 The server will continue to print, periodically, the message
311 "select timed out" as it waits for clients to connect.
315 $ ./SOCK_STREAM_clt -s 7 -c 1000
317 3. Observing the debugging output from the server, you should see
318 evidence that the client has connected.
320 (12761|1024) select timed out
321 (12761|1024) select timed out
322 (12761|1024) select timed out
323 (12761|1024) spawning server
324 (12761|1024) client utica-b connected from 32768
325 (12761|1024) Test for 1100 iterations
326 (12761|1024) select timed out
327 (12761|1024) select timed out
329 Note that the server expects 1100 iterations, even though we
330 configured the client for only 1000 iterations. The reason for
331 this discrepencany is that the client always runs 100 primer
332 iterations before the requested test iterations.
334 4. When the 1100 iterations are complete, observing the output from
335 the client, you should see the histogram:
338 Histogram ACE Unmarshalled Msg Synchronous Latency Test
339 (Message Size 128, Message Type octet)
344 variance: 3.62659e+06
346 num_bins: 1000 0 10000
348 Low - High Count Fraction Cumulative
349 below - 0.000 : 0 0.000 0.000
350 0.000 - 10.000 : 0 0.000 0.000
351 10.000 - 20.000 : 0 0.000 0.000
352 20.000 - 30.000 : 0 0.000 0.000
353 30.000 - 40.000 : 0 0.000 0.000
354 40.000 - 50.000 : 988 0.988 0.988
355 50.000 - 60.000 : 5 0.005 0.993
356 60.000 - 70.000 : 2 0.002 0.995
357 70.000 - 80.000 : 0 0.000 0.995
358 80.000 - 90.000 : 1 0.001 0.996
359 90.000 - 100.000 : 0 0.000 0.996
360 100.000 - 110.000 : 0 0.000 0.996
362 9960.000 - 9970.000 : 0 0.000 0.999
363 9970.000 - 9980.000 : 0 0.000 0.999
364 9980.000 - 9990.000 : 0 0.000 0.999
365 9990.000 - 10000.000 : 0 0.000 0.999
366 10000.000 - above : 1 0.001 1.000
371 ******************************************
372 * Running a Complete Test Spectrum *
373 ******************************************
375 People who are interested in round-trip latency often want to see a
376 "spectrum" of statistics for a range of payload sizes. This directory
377 includes a script, run_spectrum.pl, that automates running
378 SOCK_STREAM_clt or SOCK_SEQPACK_clt multiple times in order to
379 generate a spectrum. (The appropriate server program must be started
382 The run_spectrum.pl script offers embedded documentation. To see the
383 full documentation, please run
385 ./run_spectrum.pl --manual
387 ************************
389 ************************
391 The file sample-spectrum.png plots the spectrum data for a test run at
392 LM ATL facilities on the following systems: two Linux 2.4.18, 1600 MHz
393 Pentium 4 machines on an isolated 100Mbps Ethernet network.
395 The test conditions include several critical parameters that were set
398 sctp_rto_initial = 20
402 Testing has shown that these parameters affect maximum round-trip