This article may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist. To maintain the flow of the article, we've left these URLs in the text, but disabled the links.
|
Stress Testing Your Web Site Sara Rea |
Can your Web applications cope with hundreds of users all at once? The Microsoft InetLoad utility can help you discover the answer. |
The corporate Web application that you've spent many hours lovingly crafting is about to go live. You're running on Internet Information Server (IIS) using Active Server Pages and Active Data Objects to manipulate SQL Server data. Several hundred users will use your app concurrently at peak times. Since your application is truly scalable, deployment should be no big deal. Or will it be? Are you sure you want to find out whether it's scalable after you go live?
Maybe it would be a better idea to stress test your application first. Then you can determine whether you have an application truly worthy of the "scalable" label. Let's explore how you can use a Microsoft® utility called InetLoad to measure the performance of a Web application when it's being bombarded with hits from all sides. My sample Web page will be an ASP-designed site that uses VBScript to execute server-side code. InetLoad is a free utility that helps you stress test your applications by simulating simultaneous access by thousands of Internet users. Unlike most similar tools, it supports a number of popular Internet protocols and authentication methods. It can also be customized in several ways. I'll be using InetLoad to test pages against the HTTP protocol. To begin, you need to download and install InetLoad. Go to http://www.microsoft.com/downloads/search.asp? and look under the Internet Development Tools & SDKs section for Inetload 2.0. (Note: InetLoad only runs on Windows NT® version 4.0 and should be executed from a machine other than the one where IIS is running.) Make sure you take time to read the Inetload.doc file. InetLoad is customizable; Figure 1 lists the relevant information you will need to supply InetLoad when you run it.
Preparing a Test
|
GET <FIXED>url:/TestDirectory/SampleTestPage.asp
Your configuration can be saved by choosing File | Save As and specifying the name of an .ini file. Refer to the FAQ section of the Inetload.doc file if you get an error trying to execute InetLoad.
Analyzing the Test Results
It may be necessary to repeat the test with different numbers of users. This way you can determine at what point (if any) your Web page fails to be scalable. You may need to change your page so that more concurrent users can successfully access your pages.
Upon successful completion of your test, you will want to analyze several factors to determine if your page is acceptable. Performance Monitor should indicate whether the server was able to handle the pressure gracefully (see Figure 4 ). An important thing to note is the average CPU utilization. An average of under 70 percent is a desirable target. You will also want to note the way IIS handles the page requests. They may queue up at first and then level out as the test continues. It can be useful to determine the number of transactions per second. You will want to evaluate the results based on what will ultimately be expected of this application.
Another thing to analyze is the log file. This allows you to evaluate the latency of every page request. It will also tell you if an error was encountered and what that error was. A different log file will be created for each test. In these lines from a successful stress test
1998/03/11 10:02:46,ltcy,clnt32,cmd Server Connection,resp Connected successfully
1998/03/11 10:02:48,ltcy3778,clnt1,cmd GET/TestDirectory/SampleTestPage.asp,resp HTTP/1.0 200 OK
the first line indicates that a single-user connection was established. The second line indicates that the page request was made successfully. In the event of an error, a grumpy message with a different HTTP return code would be displayed in the place of "OK."
Conclusion
As the need for rapid development continues to grow, it is important that testing is not neglected. The Internet opens up your applications to many more potential users than traditional client-server applications. Therefore, it is even more important that stress testing be a fundamental part of your testing regime. InetLoad is an excellent tool for easily and accurately measuring your applications potential. More functionality is available within InetLoad than I have space to explain here. Take the time to download and utilize this new tool from Microsoft.
From the June 1998 issue of Microsoft Interactive Developer.