REQUEST A DEMO

Basic Web Application Loading With JMeter


Apache JMeter Logo
I needed to load test one of our web applications today. Load testing is not something I am too familiar with. A search turned up a list of open source load testing tools. At the top of the list wasApache JMeter which I decided to gave a shot based on the awesomeness of the Apache project. I am not quite blown away but I was able to get a load test up and going in about 15 minutes which makes me very very happy. Here is what I did to create a load tester for our Dovetail Seeker web search service.

Get It

 

  • Download JMeter
  • Extract it to a directory and run the .\bin\jmeter.bat batch file. You’ll likely need Java installed for this to work.
  • Now weren’t you afraid after seeing Apache that some horrible text file would need to be edited? Thankfully this is not the case.

Set It Up

 

Next create a test plan by right clicking on the test plan icon in the tree view at the left and add a Thread Group. Set the Number of Threads to 10  ramp it up in 5 seconds.

 

Thread Group

 

Right click on Thread Group and add a Loop Logic Controller which is set to loop Forever

 

Loop Controller

 

Right click on Loop Controller and add a Http Request Sampler setup the hostname, port, path appropriately.

 

For my purposes I need to Also you’ll need to add a query string representing the search query I wish to do against the server. As I don’t really want to do the same query over and over again we will use a variable to push in value to each request that is made. This apparently is done using (n)ant like notation. ${variable_name}

 

image

 

 

 

 

 

We need to define the query_value variable which will be pushing the search query into each request. Right click on the Http Request and add a Random Variable Config Element.

 

Random Variable

 

Finally it would be handy to see what’s going on. To do that add a Listener. I found the Summary listener is handy.

 

Reporting

Run it

 

To start the load test hit the Run menu and click on Start.

 

How do you know it is working? If you see the Error % column spike up to 100% you know something is wrong. Make sure you have your host and path right. You can also check your logs to see if you are getting correct requests.

Fun with Load Testing

 

I am likely doing something wrong here. I am no web test expert I just needed to load up a web application to see how a tangential mechanism behaved when the website was under load. There is a lot more depth to this tool. For example check out the View Results Tree Listener to get a trace of each request. Handy.

 

Hopefully you get the idea here you can create more than one Thread Group and create chains of Http Requests. You can control cookies and traffic numbers and all sorts of crazy things. If I was a tester I would be having much more fun but then I also might know a better tool than this. All I know is I went from zero to hitting my app with lots of users per second in 15 minutes.