Popular Posts

Monday, January 14, 2008

Performance benchmarking of data services

This is a follow up post of my previous blog entry Call MySQL stored procedures using WSAS data services.
Hence, I'd recommend the steps given there should be exercised before going through this post.

I'm going to explain how I analyzed the performance of WSAS data service using ApacheBench, which is an embedded benchmarking utility comes with Apache httpd server. The procedure is very simple and can be enhanced with more scenarios as you wish.

Step 1

Assuming the Apache web server is installed in your system, go to Apache_home/bin and run AB.exe
You will see a set of options in the command prompt.

Step 2
Invoke the data service which has been created in the previous post using Tryit utility. Make sure to switch on the 'Soap Tracer' so that we can capture the request soap envelope. Copy the soap message and save in xml (Say it is request.xml) format. You may have a look at How to monitor messages sent/received through WSAS in order to see how WSAS Soap Tracer is used.

Also , make sure to switch off the soap tracer after capturing the message since it degrades the server performance significantly.

<?xml version='1.0' encoding='UTF-8'?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<p:operation1 xmlns:p="http://ws.wso2.org/dataservice">

request SOAP envelope

Step 3

Now run the ApacheBench with the following parameters. Change the service url and request file location according to your system.
C:\Program Files\Apache Software Foundation\Apache2.2\bin>ab -p D:\testing-resources\ds-blog-request.xml -n 100 -c 20 -k -H "SOAPAction: urn:operation1" -T "text/xml; charset=UTF-8" "http://localhost:9762/services/blogds"

Lets look at the usage of the the above parameters. -p specifies the location of the request message. -n is used to specify the number of requests transmitted to the service. -c is the number of concurrent requests is being sent to the server. -k is used to switch on http keep alive settings. -H specifies the attribute headers. In our case it is Soap action of the opeartion.
-T denotes content-type header of the HTTP POST message. Finally, the service endpoint is specified.

When Apache Bench completes the transmission of the total number of requests, a comprehensive test results report will be displayed .

No comments: