1

Currently I have a servlet based application that retrieves data from an archived database and sends it back to the client as an XML over HTTP.

I want to create an "X" test client to test my database retrieval servlet for the following:

  • Min HTTP response time
  • Max HTTP response time
  • Errors received from server

The application is almost in deployment phase of development , however I need a test client that I can use after its deployed to check the application is performing as it should or if I need to do maintenance in its environment (e.g. reindex database) say after 6 months.

I am wanting it to generate thousands of HTTP requests (spam) the application.

So far I can think of two ways to do this:

  1. Multithreaded java console app that sends multiple HTTP requests simultaneously over multiple threads from my computer.
  2. A separate java servlet that sends HTTPS requests simultaneously from one server to another over multiple threads.

I am thinking that a servlet test application would be the best for the job as its already multithreaded by default.

How would I implement this though, do I just use the requestDispatcher class to call to another servlet or is there a better way?

Any advice welcome!

UBIK LOAD PACK
  • 33,980
  • 5
  • 71
  • 116
tomaytotomato
  • 3,788
  • 16
  • 64
  • 119

2 Answers2

4

Maybe you can try apache benching tool (ab). It's simple and useful. You just need to specify client threads number, total request count, and the URL you want to test, then you can get what you need.

Ivan Lee
  • 41
  • 3
  • Thanks for this also, but sadly I am using an Oracle web server. However I will keep this in mind for other projects that use LAMP. :) – tomaytotomato Nov 05 '12 at 13:58
2

I would suggest that you look into JMeter. It is a great tool for simulating loads on web applications/servlets (and other). You can define (branching) workflows, several threads, thread groups, delays, ramp up times etc.

I think it would fit your option 1) criteria perfectly.

Cheers,

Anders R. Bystrup
  • 15,729
  • 10
  • 59
  • 55
  • Thanks for this, it seems a bit complicated to operate. It has a lot of features. Perhaps a bit overkill for what I am needing. – tomaytotomato Nov 05 '12 at 11:46
  • Fair enough, your call :-) It *is* a very versatile tool, but you don't need to use all the facilities... There is a good online manual/tutorial with a lot of screenshot, eg. http://jmeter.apache.org/usermanual/build-web-test-plan.html -- I still think you should give it a shot before coding yourself. Cheers, – Anders R. Bystrup Nov 05 '12 at 12:01
  • That link is much better than the main tutorial , thanks @Anders! – tomaytotomato Nov 05 '12 at 13:59