remote-test.html
34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- start the processing -->
<html>
<head>
<link rel="stylesheet" type="text/css" href="../../docs/css/style.css"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Apache JMeter - User's Manual: Remote (Distributed) Testing</title>
<style>
.code { font-weight: bold; }
</style>
</head>
<body bgcolor="#ffffff" text="#000000" link="#525D76">
<table border="0" cellspacing="0">
<tr>
<td align="left">
<a href="http://www.apache.org"><img style="margin: 0px 30px 0px 0px" title="Apache Software Foundation" width="261" height="106" src="../../docs/images/asf-logo.png" border="0"/></a>
</td>
<td align="right">
<a href="http://jmeter.apache.org/"><img width="259" height="88" src="../../docs/images/jmeter.png" alt="Apache JMeter" title="Apache JMeter" border="0"/></a>
</td>
</tr>
</table>
<table border="0" cellspacing="4">
<tr><td>
<hr noshade size="1"/>
</td></tr>
<tr>
<td align="left" valign="top">
<table>
<tr>
<td bgcolor="#525D76">
<div align="right"><a href="index.html"><font size=-1 color="#ffffff" face="arial,helvetica,sanserif">Index</font></a></div>
</td>
<td bgcolor="#525D76">
<div align="right"><a href="generating-dashboard.html"><font size=-1 color="#ffffff" face="arial,helvetica,sanserif">Next</font></a></div>
</td>
<td bgcolor="#525D76">
<div align="right"><a href="listeners.html"><font size=-1 color="#ffffff" face="arial,helvetica,sanserif">Prev</font></a></div>
</td>
</tr>
</table>
<br>
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td bgcolor="#525D76">
<font color="#ffffff" face="arial,helvetica,sanserif">
<strong>14. Remote Testing</strong></font>
</td></tr>
<tr><td>
<blockquote>
<p>In the event that your JMeter client machine is unable, performance-wise, to simulate
enough users to stress your server or is limited at network level, an option exists to control multiple, remote JMeter
engines from a single JMeter client. By running JMeter remotely, you can replicate
a test across many low-end computers and thus simulate a larger load on the server. One
instance of the JMeter client can control any number of remote JMeter instances, and collect
all the data from them. This offers the following features:
<ul>
<li>Saving of test samples to the local machine </li>
<li>Management of multiple JMeterEngines from a single machine </li>
<li>No need to copy the test plan to each server - the client sends it to all the servers</li>
</ul>
</p><p>
<table border="1" bgcolor="#bbbb00" width="50%" cellspacing="0" cellpadding="2">
<tr><td>
Note: The same test plan is run by all the servers.
JMeter does not distribute the load between servers, each runs the full test plan.
So if you set 1000 Threads and have 6 JMeter server, you end up injecting 6000 Threads.
</td></tr>
</table>
</p>
<p>
However, remote mode does use more resources than running the same number of non-GUI tests independently.
If many server instances are used, the client JMeter can become overloaded, as can the client network connection.
This has been improved by switching to Stripped modes (see below) but you should always check that your client is not overloaded.
</p><p>Note that while you can execute the JMeterEngine on your application
server, you need to be mindful of the fact that this will be adding processing
overhead on the application server and thus your testing results will be
somewhat tainted. The recommended approach is to have one or more machines on
the same Ethernet segment as your application server that you configure to run
the JMeter Engine. This will minimize the impact of the network on the test
results without impacting the performance of the application server
itself.
</p><p><b>Step 0: Configure the nodes</b></p><p>
Make sure that all the nodes (client and servers) :
<ul>
<li>are running exactly the same version of JMeter.</li>
<li>are using the same version of Java on all systems. Using different versions of Java may work but is discouraged.</li>
</ul>
</p><p>
If the test uses any data files, <b>note that these are not sent across by the client so
make sure that these are available in the appropriate directory on each server</b>.
If necessary you can define different values for properties by editing the <tt class="code">user.properties</tt> or <tt class="code">system.properties</tt>
files on each server. These properties will be picked up when the server is started and may be
used in the test plan to affect its behaviour (e.g. connecting to a different remote server).
Alternatively use different content in any datafiles used by the test
(e.g. if each server must use unique ids, divide these between the data files)
</p><p><b>Step 1: Start the servers </b></p><p>To run JMeter in remote node, start the JMeter server component on all machines you wish to run on by running
the <tt class="code">JMETER_HOME/bin/jmeter-server</tt> (unix) or <tt class="code">JMETER_HOME/bin/jmeter-server.bat</tt> (windows) script.</p><p>Note that there can only be one JMeter server on each node unless different RMI ports are used.</p><p>Since JMeter 2.3.1, the JMeter server application starts the RMI registry itself;
there is no need to start RMI registry separately.
To revert to the previous behaviour, define the JMeter property <div align="left">
<table cellspacing="4" cellpadding="0" border="0">
<tr>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#ffffff"><pre>server.rmi.create=false</pre></td>
<td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
</table>
</div>
on the server host systems.
</p><p>
By default, RMI uses a dynamic port for the JMeter server engine. This can cause problems for firewalls,
so with you can define the JMeter property <tt class="code">server.rmi.localport</tt>
to control this port number.
If this is non-zero, it will be used as the local port number for the server engine.
</p><p><b>Step 2: Add the server IP to your client's Properties File</b></p><p>Edit the properties file <i>on the controlling JMeter machine</i>. In <tt class="code">JMETER_HOME/bin/jmeter.properties</tt>,
find the property named, "<tt class="code">remote_hosts</tt>", and
add the value of your running JMeter server's IP address. Multiple such servers can be added, comma-delimited.</p><p>Note that you can use the <tt class="code">-R</tt> <a href="get-started.html#override">command line option</a>
instead to specify the remote host(s) to use. This has the same effect as using <tt class="code">-r</tt> and <tt class="code">-Jremote_hosts={serverlist}</tt>.
E.g. </p><div align="left">
<table cellspacing="4" cellpadding="0" border="0">
<tr>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#ffffff"><pre>jmeter -Rhost1,127.0.0.1,host2</pre></td>
<td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
</table>
</div>
<p>If you define the JMeter property <tt class="code">server.exitaftertest=true</tt>, then the server will exit after it runs a single test.
See also the <tt class="code">-X</tt> flag (described below)
</p><p><b>Step 3a: Start the JMeter Client from a GUI client to check configuration</b></p><p>Now you are ready to start the controlling JMeter client. For MS-Windows, start the client with the script "<tt class="code">bin/jmeter.bat</tt>". For UNIX,
use the script "<tt class="code">bin/jmeter</tt>". You will notice that the Run menu contains two new sub-menus: "Remote Start" and "Remote Stop"
(see figure 1). These menus contain the client that you set in the properties file. Use the remote start and stop instead of the
normal JMeter start and stop menu items.</p><table border="0" cellspacing="0" cellpadding="0"><tr><td><img width='487' height='295' src="../../docs/images/screenshots/remote/run-menu00.png"/><br>
<font size="-1">Figure 1 - Run Menu</font></td></tr></table>
<p><b>Step 3b: Start the JMeter from a non-GUI Client</b></p><p>
GUI mode should only be used for debugging, as a better alternative, you should start the test on remote server(s) from a non-GUI (command-line) client.
The command to do this is:</p><div align="left">
<table cellspacing="4" cellpadding="0" border="0">
<tr>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#ffffff"><pre>
jmeter -n -t script.jmx -r
</pre></td>
<td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
</table>
</div>
<p>or</p><div align="left">
<table cellspacing="4" cellpadding="0" border="0">
<tr>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#ffffff"><pre>
jmeter -n -t script.jmx -R server1,server2,…
</pre></td>
<td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
</table>
</div>
<p>
Other flags that may be useful:
</p><dl>
<dt><tt class="code">-Gproperty=value</tt></dt><dd>define a property in all the servers (may appear more than once)</dd>
<dt><tt class="code">-X</tt></dt><dd>Exit remote servers at the end of the test.</dd>
</dl><p>
The first example will start the test on whatever servers are defined in the JMeter property <tt class="code">remote_hosts</tt>;<br>
The second example will define <tt class="code">remote_hosts</tt> from the list of servers and then start the test on the remote servers.
<br>
The command-line client will exit when all the remote servers have stopped.
</p><table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td bgcolor="#828DA6">
<font color="#ffffff" face="arial,helvetica,sanserif">
<a name="detail_instructions"><strong>14.1 Doing it Manually</strong></a>
</font>
</td></tr>
<tr><td>
<blockquote>
<p>In some cases, the jmeter-server script may not work for you (if you are using an OS platform not anticipated by the JMeter developers).
Here is how to start the JMeter servers (step 1 above) with a more manual process:</p><p><b>Step 1a: Start the RMI Registry</b></p><p>
Since JMeter 2.3.1, the RMI registry is started by the JMeter server, so this section does not apply in the normal case.
To revert to the previous behaviour, define the JMeter property <tt class="code">server.rmi.create=false</tt> on the server host systems
and follow the instructions below.
</p><p>JMeter uses Remote Method Invocation (RMI) as the remote communication mechanism. Therefore, you need
to run the RMI Registry application (which is named, "<tt class="code">rmiregistry</tt>") that comes with the JDK and is located in the "<tt class="code">bin</tt>"
directory. Before running <tt class="code">rmiregistry</tt>, make sure that the following jars are in your system classpath:
<ul>
<li><tt class="code">JMETER_HOME/lib/ext/ApacheJMeter_core.jar</tt></li>
<li><tt class="code">JMETER_HOME/lib/jorphan.jar</tt></li>
<li><tt class="code">JMETER_HOME/lib/logkit-2.0.jar</tt></li>
</ul>
The
rmiregistry application needs access to certain JMeter classes. Run <tt class="code">rmiregistry</tt> with no parameters. By default the
application listens to port <tt class="code">1099</tt>.</p><p><b>Step 1b: Start the JMeter Server</b></p><p>Once the RMI Registry application is running, start the JMeter Server.
Use the "<tt class="code">-s</tt>" option with the jmeter startup script ("<tt class="code">jmeter -s</tt>").</p><p>Steps 2 and 3 remain the same.</p></blockquote>
</td></tr>
<tr><td><br></td></tr>
</table>
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td bgcolor="#828DA6">
<font color="#ffffff" face="arial,helvetica,sanserif">
<a name="tips"><strong>14.2 Tips</strong></a>
</font>
</td></tr>
<tr><td>
<blockquote>
<p>
JMeter/RMI requires a connection from the client to the server. This will use the port you chose, default <tt class="code">1099</tt>.<br>
JMeter/RMI also requires a reverse connection in order to return sample results from the server to the client.<br>
This will use a high-numbered port. <br>
This port can be controlled by jmeter property called <tt class="code">client.rmi.localport</tt> in <tt class="code">jmeter.properties</tt>.<br>
If there are any firewalls or other network filters between JMeter client and server,
you will need to make sure that they are set up to allow the connections through.
If necessary, use monitoring software to show what traffic is being generated.
</p><p>If you're running Suse Linux, these tips may help. The default installation may enable the firewall. In that case,
remote testing will not work properly. The following tips were contributed by Sergey Ten.</p><p>If you see connections refused, turn on debugging by passing the following options.</p><div align="left">
<table cellspacing="4" cellpadding="0" border="0">
<tr>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#ffffff"><pre>
rmiregistry -J-Dsun.rmi.log.debug=true \
-J-Dsun.rmi.server.exceptionTrace=true \
-J-Dsun.rmi.loader.logLevel=verbose \
-J-Dsun.rmi.dgc.logLevel=verbose \
-J-Dsun.rmi.transport.logLevel=verbose \
-J-Dsun.rmi.transport.tcp.logLevel=verbose \
</pre></td>
<td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
</table>
</div>
<p>Since JMeter 2.3.1, the RMI registry is started by the server; however the options can still be passed in from the JMeter command line.
For example: "<tt class="code">jmeter -s -Dsun.rmi.loader.logLevel=verbose</tt>" (i.e. omit the <tt class="code">-J</tt> prefixes).
Alternatively the properties can be defined in the <tt class="code">system.properties</tt> file.
</p><p>The solution to the problem is to remove the loopbacks <tt class="code">127.0.0.1</tt> and <tt class="code">127.0.0.2</tt> from <tt class="code">/etc/hosts</tt>.
What happens is <tt class="code">jmeter-server</tt> can't connect to rmiregistry if <tt class="code">127.0.0.2</tt> loopback is not available.
Use the following settings to fix the problem.</p><p> Replace</p><div align="left">
<table cellspacing="4" cellpadding="0" border="0">
<tr>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#ffffff"><pre>`dirname $0`/jmeter -s "$@"</pre></td>
<td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
</table>
</div>
<p> With</p><div align="left">
<table cellspacing="4" cellpadding="0" border="0">
<tr>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#ffffff"><pre>
HOST="-Djava.rmi.server.hostname=[computer_name][computer_domain] \
-Djava.security.policy=`dirname $0`/[policy_file]" \
`dirname $0`/jmeter $HOST -s "$@"
</pre></td>
<td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
</table>
</div>
<p>Also create a policy file and add <tt class="code">[computer_name][computer_domain]</tt> line to <tt class="code">/etc/hosts</tt>.</p><p>In order to better support SSH-tunneling of the RMI communication channels used
in remote testing, since JMeter 2.6:</p><ul>
<li>a new property "<tt class="code">client.rmi.localport</tt>" can be set to control the RMI port used by the RemoteSampleListenerImpl</li>
<li>To support tunneling RMI traffic over an SSH tunnel as the remote endpoint using a port on the local machine,
loopback interface is now allowed to be used if it has been specified directly using the Java System Property
"<tt class="code">java.rmi.server.hostname</tt>" parameter.</li>
</ul></blockquote>
</td></tr>
<tr><td><br></td></tr>
</table>
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td bgcolor="#828DA6">
<font color="#ffffff" face="arial,helvetica,sanserif">
<a name="portchange"><strong>14.3 Using a different port</strong></a>
</font>
</td></tr>
<tr><td>
<blockquote>
<p>By default, JMeter uses the standard RMI port <tt class="code">1099</tt>. It is possible to change this. For this to work successfully,
all the following need to agree:</p><ul>
<li>On the server, start <tt class="code">rmiregistry</tt> using the new port number</li>
<li>On the server, start JMeter with the property <tt class="code">server_port</tt> defined</li>
<li>On the client, update the <tt class="code">remote_hosts</tt> property to include the new remote <tt class="code">host:port</tt> settings</li>
</ul><p>Since Jmeter 2.1.1, the jmeter-server scripts provide support for changing the port.
For example, assume you want to use port <tt class="code">1664</tt> (perhaps <tt class="code">1099</tt> is already used).</p><div align="left">
<table cellspacing="4" cellpadding="0" border="0">
<tr>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#ffffff"><pre>
C:\JMETER> SET SERVER_PORT=1664
C:\JMETER> JMETER-SERVER [other options]
</pre></td>
<td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
</table>
</div>
<div align="left">
<table cellspacing="4" cellpadding="0" border="0">
<tr>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#ffffff"><pre>
$ SERVER_PORT=1664 jmeter-server [other options]
</pre></td>
<td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
</table>
</div>
<p>
In both cases, the script starts rmiregistry on the specified port,
and then starts JMeter in server mode, having defined the "<tt class="code">server_port</tt>" property.
</p><p>
The chosen port will be logged in the server <tt class="code">jmeter.log</tt> file (<tt class="code">rmiregistry</tt> does not create a log file).
</p></blockquote>
</td></tr>
<tr><td><br></td></tr>
</table>
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td bgcolor="#828DA6">
<font color="#ffffff" face="arial,helvetica,sanserif">
<a name="sendermode"><strong>14.4 Using a different sample sender</strong></a>
</font>
</td></tr>
<tr><td>
<blockquote>
<p>
Listeners in the test plan send their results back to the client JMeter which writes the results to the specified files
By default, samples are sent back synchronously as they are generated.
This can affect the maximum throughput of the server test; the sample result has to be sent back before the thread can
continue.
There are some JMeter properties that can be set to alter this behaviour.
</p><dl>
<dt><tt class="code">mode</tt></dt><dd>sample sending mode - default is <tt class="code">StrippedBatch</tt> since 2.9. This should be set on the client node.
<dl>
<dt><tt class="code">Standard</tt></dt><dd>send samples synchronously as soon as they are generated</dd>
<dt><tt class="code">Hold</tt></dt><dd>hold samples in an array until the end of a run. This may use a lot of memory on the server and is discouraged.</dd>
<dt><tt class="code">DiskStore</tt></dt><dd>store samples in a disk file (under <tt class="code">java.io.temp</tt>) until the end of a run.
The serialised data file is deleted on JVM exit.</dd>
<dt><tt class="code">StrippedDiskStore</tt></dt><dd>remove responseData from successful samples, and use DiskStore sender to send them.</dd>
<dt><tt class="code">Batch</tt></dt><dd>send saved samples when either the count (<tt class="code">num_sample_threshold</tt>) or time (<tt class="code">time_threshold</tt>) exceeds a threshold,
at which point the samples are sent synchronously.
The thresholds can be configured on the server using the following properties:
<dl>
<dt><tt class="code">num_sample_threshold</tt></dt><dd>number of samples to accumulate, default <tt class="code">100</tt></dd>
<dt><tt class="code">time_threshold</tt></dt><dd>time threshold, default 60000 ms = 60 seconds</dd>
</dl>
See also the Asynch mode, described below.</dd>
<dt><tt class="code">Statistical</tt></dt><dd>send a summary sample when either the count or time exceeds a threshold.
The samples are summarised by thread group name and sample label.
The following fields are accumulated:
<ul>
<li><tt class="code">elapsed time</tt></li>
<li><tt class="code">latency</tt></li>
<li><tt class="code">bytes</tt></li>
<li><tt class="code">sample count</tt></li>
<li><tt class="code">error count</tt></li>
</ul>
Other fields that vary between samples are lost.
</dd>
<dt><tt class="code">Stripped</tt></dt><dd>remove responseData from successful samples</dd>
<dt><tt class="code">StrippedBatch</tt></dt><dd>remove responseData from successful samples, and use Batch sender to send them.</dd>
<dt><tt class="code">Asynch</tt></dt><dd>samples are temporarily stored in a local queue. A separate worker thread sends the samples.
This allows the test thread to continue without waiting for the result to be sent back to the client.
However, if samples are being created faster than they can be sent, the queue will eventually fill up,
and the sampler thread will block until some samples can be drained from the queue.
This mode is useful for smoothing out peaks in sample generation.
The queue size can be adjusted by setting the JMeter property
<tt class="code">asynch.batch.queue.size</tt> (default <tt class="code">100</tt>) on the server node.
</dd>
<dt><tt class="code">StrippedAsynch</tt></dt><dd>remove responseData from successful samples, and use Async sender to send them.</dd>
<dt><tt class="code">Custom implementation</tt></dt><dd>set the mode parameter to your custom sample sender class name.
This must implement the interface <tt class="code">SampleSender</tt> and have a constructor which takes a single
parameter of type <tt class="code">RemoteSampleListener</tt>.
</dd>
</dl>
</dd>
</dl><p>
<table border="1" bgcolor="#bbbb00" width="50%" cellspacing="0" cellpadding="2">
<tr><td><tt class="code">Stripped</tt> mode family strips <tt class="code">responseData</tt> so this means that some Elements that rely
on the previous <tt class="code">responseData</tt> being available will not work.<br>
This is not really a problem as there is always a more efficient way to implement this feature.
</td></tr>
</table>
</p>
<p>The following properties apply to the <tt class="code">Batch</tt> and <tt class="code">Statistical</tt> modes:</p><dl>
<dt><tt class="code">num_sample_threshold</tt></dt><dd>number of samples in a batch (default <tt class="code">100</tt>)</dd>
<dt><tt class="code">time_threshold</tt></dt><dd>number of milliseconds to wait (default 60 seconds)</dd>
</dl></blockquote>
</td></tr>
<tr><td><br></td></tr>
</table>
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td bgcolor="#828DA6">
<font color="#ffffff" face="arial,helvetica,sanserif">
<a name="retries"><strong>14.5 Dealing with nodes that failed starting</strong></a>
</font>
</td></tr>
<tr><td>
<blockquote>
<p>
For large-scale tests there is a chance that some part of remote servers will be unavailable or down.
For example, when you use automation script to allocate many cloud machines and use them as generators,
some of requested machines might fail booting because of cloud's issues.
Since JMeter 2.13 there are new properties to control this behaviour.
</p><p>
First what you might want is to retry initialization attempts in hope that failed nodes just slightly delayed their boot.
To enable retries, you should set <tt class="code">client.tries</tt> property to total number of connection attempts.
By default it does only one attempt. To control retry delay, set the <tt class="code">client.retries_delay</tt> property
to number of milliseconds to sleep between attempts.
</p><p>
Finally, you might still want to run the test with those generators that succeeded initialization and skipping failed nodes.
To enable that, set the <tt class="code">client.continue_on_fail=true</tt> property.
</p></blockquote>
</td></tr>
<tr><td><br></td></tr>
</table>
</blockquote>
</p>
</td></tr>
<tr><td><br></td></tr>
</table>
<br>
<table>
<tr>
<td bgcolor="#525D76">
<div align="right"><a href="index.html"><font size=-1 color="#ffffff" face="arial,helvetica,sanserif">Index</font></a></div>
</td>
<td bgcolor="#525D76">
<div align="right"><a href="generating-dashboard.html"><font size=-1 color="#ffffff" face="arial,helvetica,sanserif">Next</font></a></div>
</td>
<td bgcolor="#525D76">
<div align="right"><a href="listeners.html"><font size=-1 color="#ffffff" face="arial,helvetica,sanserif">Prev</font></a></div>
</td>
</tr>
</table>
</td>
</tr>
<tr><td>
<hr noshade size="1"/>
</td></tr>
<tr>
<td>
<table width=100%>
<tr>
<td>
<font color="#525D76" size="-1"><em>
Copyright © 1999-2017, Apache Software Foundation
</em></font>
</td>
<td align="right">
<font color="#525D76" size="-1"><em>
$Id: remote-test.xml 1768727 2016-11-08 16:38:30Z fschumacher $
</em></font>
</td>
</tr>
<tr><td colspan="2">
<div align="center"><font color="#525D76" size="-1">
Apache, Apache JMeter, JMeter, the Apache feather, and the Apache JMeter logo are
trademarks of the Apache Software Foundation.
</font>
</div>
</td></tr>
</table>
</td>
</tr>
</table>
</body>
</html>
<!-- end the processing -->