(The following article was provided by Sebastian Marsky, developer in the Transportation Route Planning Server team. Thank you so much!) [Edit 27.03.2012]: Please check our blog post of 27.03.2012
Today I’d like to give you an introduction to do some quick benchmarking on your PTV xServer installation.
The tool I’ll use for that is JMeter (1), an open source multi-platform test software, provided by the Apache project. It is very easy to setup and has integrated plugins for graphical analysis.
Besides a good tooling the other important thing in a benchmark is a good basis of diverse input data (e.g. to avoid caching phenomena) and this is often not easy to generate manually.
For this test I’ll use the data provided with your xServer delivery which is actually data for the PTV xRequestRunner. For every PTV xServer there are several data sets to meet general and special requirements.
You’ll find the test data in your delivery located at /xserver/tools/xrequestrunner/benchmarks/, and then at the according PTV xServer directory.
We’ll setup an PTV xRoute Server test, so take a set from the according directory, e.g. xroute/standardCase/uc-calculateRoute-default-mindist500km.zip. In the ZIP you’ll find two files: The actual test data in a CSV file (in this case Routing-EU-mindist500km.csv) and an XML-template, which describes the SOAP-XML-Request (in this case request-default-1to1.xml.tmpl).
Start JMeter (I use latest version 2.6 here), and do the following:
- to the top node ad a Thread Group
- to the thread group add a sampler of type SOAP/XML-RPC Request
- to the request sampler add a config element of type CSV Data Set Config
- to the request sampler add a View Results Tree listener
- to the request sampler add a Aggregate Report listener
- to the request sampler add a Graph Results listener
Now setup the CSV input data according to the following screenshot
- take care of the CSV file name and make sure, that its located at the same directory your test is (1)
- fill the variable names, cut them from the first line of the CSV file and replace “;” with “,” (2)
Setup the actual SOAP-XML request
- set the URL to your PTV xServer webservice
(which is : (1)
- copy/paste the XML request from the request-default-1to1.xml.tmpl template file (2)
Setup the thread group
- set the loop count to a value of 1000 or whatever you like
- this will use the first 1000 entries from the CSV file
Just start the test (Run -> Start or STRG+R), and wait until its finished. Now take a look at the listeners tabs
View Results Tree
logs every request and the responsePlease note that due to the huge size of the responses, this listener takes some CPU-time during the test. For real test, you should deactivate this plugin to avoid
- Graph Results
shows a graph with several useful charts
- Aggregate Report
gives you a good summary of the benchmark
After reading this short introduction you should be able to use JMeter in an PTV xServer environment as an easy and convenient way to setup your own benchmarks.
If you like JMeter, but want to get nicer charts, you should take a look at the JMeter Plugins project (2).