Skype Automation in Powershell : Don’t have to dial in conference codes anymore
Running .NET CF applications and code on Symbian based Phones

Serializing Web Service Requests to run Load Tests

A few days ago we wanted to how would our application behave under high stress scenarios and wanted to take as little time as possible. We thought we would be able to use Microsoft Web Stress tool. But it turned out that the tool location is not available anymore on the Microsoft web site. We tried an older version, but it seemed that it was not a proper tool to run load tests.  We have a custom Sharepoint application running in front of an application server. All of the core business logic goes through the application server. The web application calls the application server via a few web service calls. This is how the application is supposed to be deployed.


Since all the core requests are coming from web to the app via web services, and our goal was to to stress test the application server, we could simulate stress by calling the web service in the application server.


The first and basic issue is, that we had very limited time and in that time it was not possible write real life test scenarios for most of the use cases.

The second issue was, the test should be as realistic as possible. Writing tests may not be best way.


The solution was to record a real use case, and then play it again many times with a little varied parameters.


So we injected a little code in the web service (we could do this with context handlers, but we did not have the time). Serialized each of the web requests sequentially, In the start of a use case we would clear the folder where we were serializing the web requests. After we have finished the use case then we would de-serialize the requests and inject some randomizing items to a few parameters that changes in real life and then run in multiple thread to simulate real stress. The diagram below shows the whole process. The process if repeated in multiple threads to simulate multiple clients and it worked.


So if any of you want to simulate real life scenario without writing too much code, give this a try. Will update this blog with sample code a few days later.



One easy way to quickly write load test scripts is to record actions using Fiddler and Fiddler can generate VS WebTest from it. Then you can run those VS WebTests in a load test. No coding required.


Nice idea..............

The comments to this entry are closed.