Thursday, 30 April 2009

Load Testing with Visual Studio Team System

Visual Studio Team System offers a lot functionality for automated testing. While you can write unit tests with MSTest in “Visual Studio 2005/2008 Team Edition for Developers” you’ll need “Visual Studio 2005/2008 Team Edition for Testers” to author Web Tests and Load Tests.

Web Tests are essentially a script to execute against a web site, a Load Test can execute one or more Web Tests with a set of parameters. These parameters can be:

  • User count (this can ramp up and down)
  • Browser mix (IE 5.5/6.0/7.0/8.0, Firefox 2.0/3.0 and Netscape 6.0 plus Smart Phone and Pocket PC)
  • Network mix (LAN, Cable, dial-up)

Once you have authored your Web and Load Tests you can run the Load Tests from “Visual Studio 2005/2008 Team Edition for Testers”. In this scenario you are limited in that you can only simulate a limited number of users (exact number depends on your machine). To scale out and simulate the load of many thousands of users you can use the “Visual Studio Team System 2005/2008 Test Load Agent”. This is available as a separate product, download a 90 day trial here:

http://www.microsoft.com/downloads/details.aspx?FamilyID=572e1e71-ae6b-4f92-960d-544cabe62162&displaylang=en

The “Visual Studio Team System 2005/2008 Test Load Agent” allows you to set up Test Agents and Test Controllers. Test Agents simulate requests from Users and Test Controllers orchestrate the Test Agents.

LoadTestingWithVSTS

According to the documentation, a Test Agent on a server with a 2.6 GHz processor and 2GB RAM can simulate approximately 1000 virtual users. A single Test Controller installed on a similar specification server can orchestrate approximately 30 Test Controllers. These numbers are approximate as the specifics will depend on your web application. If your web application is graphics heavy you will not be able to simulate as many users to due to increase memory demands of the requests for larger pages.

These are very rough numbers, but if your average web page size is 300KB and you have 1000 virtual users simulated per Test Agent, the server running the Test Agent needs to deal with up 300MB worth of requested data at once. The load on each Test Agent is mitigated in that the Test Agent simulates user thinking times (times are configurable in the scripts). So each machine won’t be making 1000 requests constantly, more like 1000 requests every 4 or 5 seconds. So a server with 2GB RAM supporting 1000 virtual users seems a reasonable basis for estimates.

If you want to simulate 10,000 users you would need:

1 Test Agent per 1000 virtual users = 10 x Test Agents = 10 x servers

1 Test Controller per 30 Test Agents = 1 x Test Controller = 1 x servers

This means a total of 11 servers, each with 2.6GHz processor and 2GB RAM.

You can find more information on the metrics here: http://msdn.microsoft.com/en-us/library/ms253092.aspx


About Me