Performance and scalability: Please recommend tools for stress-testing plain java methods
Could anyone please recommend their favorite tool for multi-threaded stress-test, on plain java classes ?
- Posted by: sol myr
- Posted on: August 27 2005 04:51 EDT
In more detail: I'm doing unit-test for my business-logic layer, consisting of plain java methods (only mathematical calculations. No web interface, no session beans, no swing).
This should be a stress test (the usual - launch multiple threads to periodically invoke a method, and register statistics on correctness & response times)
Any recommendations would be appreciated . Thanks !
- RE: Please recommend tools for stress-testing plain java methods by Hussein Badakhchani on September 03 2005 22:36 EDT
- Please recommend tools for stress-testing plain java methods by Alejandro Castano on September 06 2005 09:23 EDT
I had a similar requirement, I needed to accurately measure method response times at varying loads but without any major emphasis on capturing failures.
To test the different tools effects I needed a benchmark and for this I had a simple class which looped calling methods on the test class a few thousand times.
I tried out the Grinder http://grinder.sourceforge.net and found that if you use the right jdk although it is not designed for this sort of testing it gave results that were in agreement with a base class. The grinder can be configured to generate a variety of loads easily and suppots Jython. Running it with JRocket produced result times that matched the benchmarks from my dumb class. With Suns JDK 1.4 and earlier the result times did not match at all. I did not get round to testing it with JDK 1.5 or any other vendors JDKs.
I toyed with Junit which prints thest case duration but these added a significant overhead when compared to the the benchmarks.
I guess you can also use JProbe and Optimizit as well.
If you try out the Grinder or find a niftier tool, please let me know.
I've worked with JMeter, and i think it's excellent. You can do load tests and stress test.
You can record a complete session of what you do normally in the application, and later on you could run it exactly the same. If you need it to be dynamic, no problem, you can set it up to receive parameters from the server and use them for the next request.
You can also simulate multiple users (threads), for as many times as you need it, and you can seperate each request by an specific time rate.
The framework also has several graphics and logs so you can review the results.
Hope it helps.
PS/ if you need a little bit more help, you can write me at email@example.com