ASP. NET stress testing

Source: Internet
Author: User

For Web applications that directly face Internet users, you must be extremely careful when developing and designing them, because no one knows the speed at which Web applications can be accessed and run per unit of time. Therefore, after the completion of the program design, we finally conduct some rigorous or even rigorous tests on the program, to determine whether the program can maintain normal and relatively stable efficiency under complex network environments and high-pressure server load.

What is a negative pressure test?
Negative Pressure tests are generally performed on Web applications, such as websites. The purpose of the negative pressure test is to determine whether Web applications can correctly and securely handle uncertain requests submitted by various users in the real network environment, and to check the robustness of the program.
Another purpose of the negative pressure test is to intentionally provide enough requests to observe the responsiveness of the program in this case.

Why negative pressure testing?
Maybe everyone is familiar with a very famous search engine Google. We know that this search engine not only has accurate search results, but also has an extremely fast search speed. The search result is accurate, which is the performance of the program algorithm. The fast search speed is related to the robust behavior of components and programs of the entire system. If you want to write your own program, you can also "easily" in the case of high traffic, it is necessary to conduct a negative pressure test on the program.
For websites or programs with a large access volume, especially those with some popular topic programs, it is best to perform a relatively complete negative pressure test before the website or program is officially published, in addition, even if the program is optimized or the server hardware is properly configured, the website will not be ugly or even crash when the number of users increases dramatically.

Test with Act

About Act
Act (or msact) is a set of tool used for program testing in Microsoft Visual Studio and Visual Studio. NET. It is also required for our negative pressure testing. The Act not only records detailed data parameters of the program running, but also displays the program running status in charts. It is easy to install and use, and the results are easy to read. It is an ideal testing tool.

Install Act
At the very least, of course we need Visual Studio, and the Act does not seem to have a separate version yet. Here, we test the Running Performance of a Web service under high load. First, open Act () in Visual Studio ()

The program will prompt whether to create a new project, click "yes", and enter a text description to display the following interface (Figure 2 ):

After activating act, we can start testing.

Create a new test
Choose action> new test (3)


A wizard page appears (figure 4)

We are very familiar with the Wizard. Read the instructions on each interface carefully and select the appropriate one.

Edit Test
After the preceding settings, the following page is displayed (figure 5 ):


Obviously, the above interface is divided into three parts manually, and each part has different colors. The three parts of different colors are:
Blue on the left: navigation bar, test entry and result population;
Green on the upper right: the prompt message bar;
Red at the bottom right: vbs code bar. Edit the vbs Code required for the test. Whether the test is successful or not depends on the code execution. Therefore, it is best to carefully consider these codes and perform multiple tests;
Before testing, set the test options (menu [action]-> [properties]) 6.


On the preceding page, set two parameters:
(1) test duration settings. Here, the test time is set. The default value is 5 minutes;
(2) set some test performance data on the counters tab;
After the preceding settings are complete, you can modify the vbs code. We do not need to traverse the entire vbs code, just look at some of the main ones:
Test. sendrequest ("http: // localhost /")
The above is the default code. We can change it to the following code:
Test. sendrequest ("http: // localhost/philipq/wsmessages/wsmsg. asmx/mpost? Webkey = w2k & uname = aD & upassword = PWD & uto = Admin & umessage = act + test ")
The above code should be modified according to the characteristics of the program to achieve the best test results.

Run the test
Click Start in the toolbar to start the test ):

During the test, the following window is displayed ():

The preceding page displays the test time, remaining time, number of requests submitted per second, total number of submitted requests, and number of errors. Click Show Details to view detailed data.
After the test is complete, you can view the test results.

Read test results
After the test is completed, you can click the result branch on the left of Figure 2 to view the test results. In the report column on the right, you can view the following data: Overview, graphs, requests, etc, is an example of overview data:


From the above report, we can see that the testing program submitted request23 times per second, a total of 1400 times.

Use of test results
Based on the test results, we can know the running status of the program and the capacity of the server under high load. Based on the data, we can determine the program performance and server performance, so as to predict the possible situation and server needs to be improved after the program is officially used.

Other options
Although the Act described above is good, not every user uses Visual Studio after all. At this time, we can consider other tools for testing.

Microsoft Web application stress tool (was)
This tool is a Microsoft product like act, but it is not integrated with Visual Studio and can be used independently. It seems that this program is still being tested, but some basic functions are quite complete, and almost all functions of Act can be completed. Moreover, was is simpler to use and more complete and clear to set. Another feature of this tool is that its reports are plain text files rather than popular HTML file formats. However, the content is not inferior at all.
For more information about this tool, refer:
Http://homer.rte.microsoft.com/

Open System Testing architecture (opensta)
The feature of opensta is that it can simulate many users to access the websites to be tested. It is a software with powerful functions and complete custom settings. However, most of these settings need to be completed through scripts, therefore, you must learn how to write scripts before using the software. If you need to complete complex functions, script requirements are still relatively high, of course, this is also its advantage, some programmers do not care about these scripts.
This software is completely free of charge and the source code can be downloaded. If you are interested, you can modify the software to meet the requirements.
For more information about this tool, refer:
Http://www.opensta.org/
Http://opensta.sourceforge.net/

Pureload
Pureload is a Java-based testing tool. Its script code fully uses XML. Therefore, the compilation of these codes is very simple. Its Testing Report contains text and graphics and can be output as HTML files. Because it is a Java-based software, you can use Java Beans API to enhance software functionality.
For more information about this tool, refer:
Http://www.pureload.com/

Qaload
Qaload can not only test web applications, but also test backend things, such as SQL Server, as long as it supports protocols. In addition, qaload can not only test windows, it can also test systems such as Aix, HP-UX, and Solaris. However, this software is expensive.
For more information about this tool, refer:
Http://www.compuware.com/products/qacenter/qaload/

LoadRunner
For a wealthy company, this software may be more suitable. Its functionality is comparable to that of qaload, which is used by well-known companies on the market, such as IBM, sun, and Oracle. However, its price is unattainable and proportional to the function.
For more information about this tool, refer:
Http://www-heva.mercuryinteractive.com/products/loadrunner/

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.