jmeter_distributed_testing_step_by_step.html
16.3 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
<!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"/>
<meta name="author" value="JMeter developers">
<meta name="email" value="dev@jmeter.apache.org">
<title>Apache JMeter - Apache JMeter Distributed Testing Step-by-step</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="jmeter_proxy_step_by_step.html"><font size=-1 color="#ffffff" face="arial,helvetica,sanserif">Next</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">
<a name="distributed-testing"><strong>26. Apache JMeter Distributed Testing Step-by-step</strong></a></font>
</td></tr>
<tr><td>
<blockquote>
<p>
This short tutorial explains how to use multiple systems to perform stress testing. Before we start, there are a couple of things to check.
</p><ul>
<li>the firewalls on the systems are turned off or correct ports are opened.</li>
<li>all the clients are on the same subnet.</li>
<li>the server is in the same subnet, if <tt class="code">192.x.x.x</tt> or <tt class="code">10.x.x.x</tt> IP addresses are used.
If the server doesn't use <tt class="code">192.xx</tt> or <tt class="code">10.xx</tt> IP address, there shouldn't be any problems.</li>
<li>Make sure JMeter can access the server.</li>
<li>Make sure you use the same version of JMeter and Java on all the systems. Mixing versions will not work correctly.</li>
</ul><p>
Once you've made sure the systems are ready, it's time to setup remote testing. The tutorial assumes you already
have JMeter installed on all the systems. The way JMeter works is one master controller initiates the test on multiple slave systems.
</p><p>
<table border="1" bgcolor="#bbbb00" width="50%" cellspacing="0" cellpadding="2">
<tr><td>In this tutorial we use GUI Mode just for demonstration. In real life you should use NON GUI mode to start your load test</td></tr>
</table>
</p>
<table border="0" cellspacing="0" cellpadding="0"><tr><td><img width='610' height='462' src="../../docs/images/screenshots/distributed-jmeter.svg"/><br>
<font size="-1">One master controls multiple slaves</font></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="terminology"><strong>26.1 Terminology</strong></a>
</font>
</td></tr>
<tr><td>
<blockquote>
<p>
Before we dive into the step-by-step instructions, it's a good idea to define the terms and make sure the definition is clear.
</p><dl>
<dt>Master</dt><dd>the system running JMeter GUI, which controls the test</dd>
<dt>Slave</dt><dd>the system running <tt class="code">jmeter-server</tt>, which takes commands from
the GUI and send requests to the target system(s)</dd>
<dt>Target</dt><dd>the webserver we plan to stress test</dd>
</dl><table border="0" cellspacing="0" cellpadding="0"><tr><td><img width='602' height='360' src="../../docs/images/screenshots/distributed-names.svg"/><br>
<font size="-1">Categories of systems</font></td></tr></table>
</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="step-by-step"><strong>26.2 Step-by-Step</strong></a>
</font>
</td></tr>
<tr><td>
<blockquote>
<ol>
<li>On the slave systems, go to <tt class="code">jmeter/bin</tt> directory and execute
<tt class="code">jmeter-server.bat</tt> (<tt class="code">jmeter-server</tt> on unix).
</li>
<li>On master system acting as the console, open windows explorer and go to
<tt class="code">jmeter/bin</tt> directory</li>
<li>Open <tt class="code">jmeter.properties</tt> in a text editor</li>
<li>Edit the line <tt class="code">remote_hosts=127.0.0.1</tt></li>
<li>Add the IP address. For example, if I have JMeter server running on <tt class="code">192.168.0.10</tt>,
…, <tt class="code">192.168.0.15</tt>, the entry would like like this:
<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>remote_hosts=192.168.0.10,192.168.0.11,192.168.0.12,192.168.0.13,192.168.0.14</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>
</li>
<li>Start JMeter.</li>
<li>Open the test plan you want to use</li>
</ol><table border="0" cellspacing="0" cellpadding="0"><tr><td><img width='483' height='266' src="../../docs/images/screenshots/example-simple-plan.png"/><br>
<font size="-1">Simple test plan</font></td></tr></table>
</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="starting"><strong>26.2 Starting the Test</strong></a>
</font>
</td></tr>
<tr><td>
<blockquote>
<p>
At this point, you are ready to start load testing. If you want to double check
the slave systems are working, open <tt class="code">jmeter.log</tt> in your editor. You should see the following in the log.
</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>
Writing log file to: /XXXX/XXXXX/bin/jmeter-server.log
Created remote object: UnicastServerRef [liveRef: [endpoint:[192.X.X.X:XXXXX](local),objID:[-6a665beb:15a2c8b9419:-7fff, 3180474504933847586]]]
</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 do not see this message, it means <tt class="code">jmeter-server</tt> did not start correctly. For tips on
debugging the issue, <a href="#tips">go to the tips section</a>. There are two ways to
initiate the test: a single system and all systems.
</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="start-single-client"><strong>26.3 Start a single clients</strong></a>
</font>
</td></tr>
<tr><td>
<blockquote>
<ol>
<li>Click Run at the top</li>
<li>Select Remote Start</li>
<li>Select the IP address</li>
</ol><table border="0" cellspacing="0" cellpadding="0"><tr><td><img width='490' height='196' src="../../docs/images/screenshots/example-remote-start.png"/><br>
<font size="-1">Start a single slave</font></td></tr></table>
</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="start-all-clients"><strong>26.4 Start all clients</strong></a>
</font>
</td></tr>
<tr><td>
<blockquote>
<ol>
<li>Click Run at the top</li>
<li>Select Remote Start all or use <span class="keycombo"><span class="keysym">Ctrl</span> + <span class="keysym">Shift</span> + <span class="keysym">R</span></span></li>
</ol><table border="0" cellspacing="0" cellpadding="0"><tr><td><img width='410' height='155' src="../../docs/images/screenshots/example-remote-start-all.png"/><br>
<font size="-1">Start all slaves</font></td></tr></table>
</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="limitations"><strong>26.5 Limitations</strong></a>
</font>
</td></tr>
<tr><td>
<blockquote>
<p>
There are some basic limitations for distributed testing. Here's the list of the known items in no specific order.
</p><ol>
<li>RMI cannot communicate across subnets without a proxy; therefore neither can JMeter without a proxy.</li>
<li>Since version 2.9, JMeter sends all the test results stripping Response data to the controlling console, this allows
us to reduce impact on network IO. Ensure you monitor your network traffic so that this trafic does not incur contention</li>
<li>A single JMeter client running on a 2-3 GHz CPU (recent CPU) can handle 1000-2000 threads depending on the type of test.</li>
</ol></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="additional-resources"><strong>26.6 Additional resources</strong></a>
</font>
</td></tr>
<tr><td>
<blockquote>
<p>
<a href="http://wiki.apache.org/jmeter/JMeterFAQ#How_to_do_remote_testing_the_.27proper_way.27.3F">Wiki page on remote testing</a>
</p><p>
<a href="remote-test.html">Remote Testing in the user manual</a>
</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>26.7 Tips</strong></a>
</font>
</td></tr>
<tr><td>
<blockquote>
<p>
In some cases, the firewall may still be blocking RMI traffic.
</p><h3>Anti Virus and Firewall</h3><p>
<table border="1" bgcolor="#bbbb00" width="50%" cellspacing="0" cellpadding="2">
<tr><td>Antivirus should be stopped during a Load Test as it can drastically impact timings leading to wrong results.</td></tr>
</table>
</p>
<p>
Firewall needs to be stopped from windows services or at least some ports need to be opened.
</p><ol>
<li>Open control panel</li>
<li>Open administrative tools</li>
<li>Double click services</li>
<li>Go to down to Symantec anti virus, right click and select stop</li>
</ol><h3>Windows firewall</h3><ol>
<li>Open network connections</li>
<li>Select the network connection</li>
<li>Right click and select properties</li>
<li>Select advanced tab</li>
<li>Uncheck internet connection firewall</li>
</ol><h3>Linux</h3><p>
On Linux, iptables might be turned on by default. For instructions, please refer to the
<a href="remote-test.html">Remote Testing in the user manual</a>
</p><p>
On RedHat (or derivatives), iptables is turned on by default. Execute
<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>service iptables stop</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>
to stop the Linux firewall or ensure you open the correct ports.
</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="jmeter_proxy_step_by_step.html"><font size=-1 color="#ffffff" face="arial,helvetica,sanserif">Next</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$
</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 -->