Helping ordinary people create extraordinary websites!
HOME TUTORIALS SCRIPTS WEB HOSTING BLOG FORUM
Get Our Newsletter
Email:

Eye On Performance: A Load Of Stress

By Jack Shirazi & Kirk Pepperdine
2004-01-22


One size doesn't fit all

Unfortunately, there is no generic stress test tool, because every application is different in what inputs it takes and how it deals with them. But for many J2EE applications, communications from the client arrive at the server using the HTTP protocol. Fortunately, there are many load testing tools that can simulate user activity over HTTP in a controlled and reproducible manner. These range from free tools, such as Apache JMeter, The Grinder, and PushToTest, to quite expensive tools such as Mercury Astraload. Typically, you get what what you pay for -- the more expensive the tool, the more it can do. To understand the differences, let's consider first what the most basic type of load test tool does.

If you were building your own load test tool, then you likely would start by writing a program that runs one thread per simulated client. Each thread would need to communicate with the server, probably using the java.net.URL classes. This approach would give you a bare-bones HTTP client simulation that could do GETs and PUTs. All each thread needs to do is send an HTTP request, collect the answer, wait some time (simulating "think time"), and repeat. The sequence of actions can be quite easily extracted into a separate configuration file. And presto, you've got a basic load testing tool. You will probably need to add some configuration options for how many threads (simulated clients) to run and whether they all start together or slowly increase the load. And, of course, you'll want to time the interactions with the server, because this is at the core of what you are trying to measure.

Tutorial Pages:
» Stress testing and the factors that go into choosing the right tool for your project
» Stress testing, load testing
» One size doesn't fit all
» If it were only that easy...
» A rich feature set
» The final word
» Resources


First published by IBM developerWorks


 | Bookmark
Related Tutorials:
» All about JAXP, Part 1
» Make Database Queries Without the Database
» Load List Values for Improved Efficiency
» 2 Ways To Implement Session Tracking
» A Simple Way to Read an XML File in Java
» Develop Aspect-Oriented Java Applications with Eclipse and AJDT