O'Reilly logo

ASP.NET Cookbook by Geoffrey T. LeBlond, Michael A Kittel

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

10.8. Stress Testing a Web Application or Service

Problem

You want to stress test your ASP.NET web application or service to analyze its performance and identify any scalability problems.

Solution

Use the Application Center Test (ACT), included in the Enterprise Architect and Enterprise Developer editions of Visual Studio .NET, to simulate a large group of users by opening multiple connections to the server and rapidly sending HTTP requests. The easiest way to accomplish this is to record a test script and then modify the test properties to match the stress test you want to simulate. In the case of a web service, you can record the steps you’d take to manually enter settings into the web service’s test page, and then have the ACT tool automatically replay the test script to simulate a large number of users simultaneously accessing the service.

For example, to stress test our sample web service in Recipe 11.1, follow these steps:

  1. Add a new Application Center Test project to the Solution Explorer (available under Other Projects in the Project Types list).

  2. Click on the new ACT project in Solution Explorer, select File Add New Item from the menu, and choose “Browser Recorded Test (.vbs)” from the list of templates.

  3. Start Browser Record mode and when the browser opens, navigate to the web service’s ASMX page, choose a method to stress test, enter the appropriate values (as shown in Figure 10-6), and invoke the method.

  4. When you see the XML returned by the web service, click Stop on the recorder ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required