views:

586

answers:

4

I want to stress test a web service method by calling it several thousand times in quick succession. The method has a single string parameter that I will vary on each call.

I'm planning on writing a Powershell script to loop and call this method a number of times.

Is there a better way to do this?

+2  A: 

If you run call after call - it's not going to help you too much, as it will not show you how the service behaves under a heavy load of many simultaneous connections.

Go with some multi-threaded solution (I do not know if powershell has this).

Some opensource testing tools are listed here. Just set your web service to accept GET requests as well, not only SOAP(default), so you can form the urls.

Sunny
A: 

Personally, I'd use something like openSTA.

This allows a session with a web site to be recorded and then played back via a relatively simple script language.

You can also easily test web services and write your own scripts.

It allows you to put scripts together in a test in any way you want and configure the number of iterations, the number of users in each iteration, the ramp up time to introduce each new user and the delay between each iteration. Tests can also be scheduled in the future.

It's open source and free.

It produces a number of reports which can be saved to a spreadsheet. We then use a pivot table to easily analyse and graph the results.

nzpcmad
A: 

It really depends on if there are other requirements. Such as logging, history, etc.

If quick and dirty is all you need, then you're good.

If you need something more robust then you can look at either custom building a test harness in the language of your choice or using things such as Mercury, MS Team Tester, nUnit or the like.

Chris Lively
+1  A: 

For these situations I would use JMeter. You need to play around with it first, but it is very flexible, it will run requests in different threads, it will display the results graphically and it also allows you to script your jobs.

I would also recommend to start it not in the same machine as the server and if possible start two or more instances in different machines to simulate the load.

kgiannakakis