Tuesday, April 22, 2008

Performance testing of your web application – JMeter

Performance testing doesn’t require expensive tools to simulate thousands of users. Apache JMeter is a 100% pure Java desktop application designed to load test functional behavior and measure performance. It was originally designed for testing Web Applications but has since expanded to other test functions.

What can I do with it?

Apache JMeter may be used to test performance both on static and dynamic resources on:

  • files
  • Servlets
  • Perl scripts
  • Java Objects
  • Databases and Queries
  • FTP Servers and more…

It can be used to simulate a heavy load on a server, network or object to test its strength or to analyze overall performance under different load types. You can use it to make a graphical analysis of performance or to test your server/script/object behavior under heavy concurrent load.

Why would I use it?

  • Start doing performance testing as part of your unit testing. You can call your JMeter test from your JUnit (or NUnit, CPPUnit, or any xUnit framework) using an Ant task
  • It can be used with many programming languages, not just Java. This includes Perl, C#, C++, etc.
  • With the system running jmeter-server, which takes commands from the GUI (see screenshot on right) and send requests to the target system(s), you can deploy to multiple systems simultaneously.
  • Its open source and freely available!

JMeter is not a browser. As far as web-services and remote services are concerned, JMeter looks like a browser (or rather, multiple browsers); however JMeter does not perform all the actions supported by browsers. In particular, JMeter does not execute the Javascript found in HTML pages. Nor does it render the HTML pages as a browser does

Fully multithreading framework allows concurrent sampling by many threads and simultaneous sampling of different functions by separate thread groups. Thousands of threads can be simulated on multiple machines. This can all be called from your xUnit framework inline with your unit tests.