Using JMeter to Performance Test Web Services
Pages: 1, 2, 3, 4, 5

Running the load test

You can run the load test by either clicking Ctrl+R or choosing Run from the menu and clicking Start. Click the graph element and you will see that the chart is being populated with the data representing requests to the server, as shown on Figures 4 to 6.

Figure 4
Figure 4. Chart illustrating test results with number of threads = 5, ramp-up time = 10, loop count = 100, and loop controller set to 1 (click the image for a full-size screen shot)

We chose to display the three parameters on the charts - throughput (green line), median (purple line) and average (blue line). Let us modify the parameters of the test. To simulate a higher load on a server, let us increase the number of threads to 10 and 50 and compare server response time. Click Start again and observe the results displayed on a chart; see Figures 5 and 6.

Figure 5
Figure 5. Chart illustrating test results with number of threads = 10, ramp-up time = 5, loop count = 100, and loop controller set to 1 (click the image for a full-size screen shot)

Figure 6
Figure 6. Chart illustrating test results with number of threads = 50, ramp-up time = 5, loop count = 20, and loop controller set to 1 (click the image for a full-size screen shot)

The parameters at the bottom of the chart have the following meaning:

  • Throughput is the number of requests per minute the server has processed.
  • Average is the total time running divided by number of requests sent to the server.
  • Median is the number that represents the time, where half of server response time is lower than this number and half is higher.
  • Deviation shows how much the server response time varies, a measure of degree of dispersion, or, in other words, how spread the data are.
  • Latest sample is just the last request completed.

Just looking at these three runs and their corresponding charts we have the following valuable results:

Number of threads

Throughput, responses/minute

Average, ms

Median, ms

5

731

30

32

10

1375

38

30

50

3479

115

100

The increase in response time with the addition of threads is obvious. To continue testing we can change the number of threads, ramp-up period, and loop count. Note that we have not changed or adjusted configuration settings of the server. WebLogic Server 9.0 has an automatically configurable thread pool with configurable constraints (see Workload Management in WebLogic Server 9.0 by Naresh Revanuru, Dev2Dev, July 2006), and the table above shows that increasing the number of clients has a nonlinear impact on server response times. In fact, increasing this number two or ten times does not make a significant impact! It would, however, be interesting to run the same experiments with the number of threads close to or exceeding the default server constraints. To verify that the response received from the server is an actual SOAP response and not an HTTP error let us look at the content of the output file. This is a SOAP response that corresponds to the request shown above:

<soapenv:Envelope 
  xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
  <soapenv:Header/>
  <soapenv:Body>
    <m:calculateAreaResponse xmlns:m="http://myservice">
      <m:return>12</m:return>
    </m:calculateAreaResponse>
  </soapenv:Body>
</soapenv:Envelope>

To further visualize the test results, add the Spline Visualizer into the plan, right after Graph Results. The Spline Visualizer provides a view of all sample times. It is constructed as a continuous line, a piecewise interpolating function, and is drawn across 10 points where each point represents 10 percent of samples. Instead of connecting points with straight lines, spline charts provide a smoothed view of distribution based on polynomial approximations. The result is shown in Figure 7

Figure 7
Figure 7. Chart illustrating the same test results as shown in Figure 6 using Spline Visualizer (click the image for a full-size screen shot)

Multiple JMeters

JMeter also has a useful Remote Start feature, which allows you to launch JMeter tests from multiple machines. The client host addresses can be entered in a "jmeter.properties" file located in the bin folder. Find the remote_hosts attribute and add there the names of remote hosts separated by commas. Restart JMeter and click either Remote Start or Remote Start All from the Run menu. Some Web and application servers treat multiple requests coming from the same IP address sequentially, and requests coming from different IP addresses in parallel, therefore if it is critical to have requests coming from different machines or distribute the test load among several clients you can use this option to do so.

Pages: 1, 2, 3, 4, 5

Next Page ยป