Use Microsoft Web application stress tool for web stress testing

Source: Internet
Author: User
Tags servervariables
Use Microsoft Web application stress tool for web stress testing

WebStress testing is a popular topic.WebStress testing can effectively testWebThe running status and response time of the server.WebServer endurance testing is a good method.WebStress Testing usually uses some tools, such as Microsoft'sWeb Application Stress, Siege in Linux, comprehensive functionsWeb-CT and so on. These are excellent.WebStress Testing Tool.

Although these tools make it easy for us to test the server's affordability, their harm is even more astonishing. Even a more comprehensive test tool can be used for a smallWebThe server launches a catastrophic Denial-of-Service attack. Next I will show you how to use Microsoft'sWeb Application StressOnceWebStress Testing aims to let everyone see its great harm.

I. Brief Introduction to tools

MicrosoftWeb Application Stress ToolDeveloped by Microsoft's website testers, it is a set of tools specifically used for actual website stress testing. With this powerful stress testing tool, you can use a small number of client computers to simulate the potential impact of a large number of users going online on website services, before the website is launched, perform a test on the website you designed in the real environment to identify potential system problems and further adjust and set up the system. These features enable the d. o.s bombing function.

Tip: D. o.s blocks your service by crashing your service computer or pressing it across. To put it simply, it is to make your computer provide more services, so that your computer can be stuck on the verge of crash or crash.

Ii. Simple tool settings

OpenWeb Application Stress Tool, A concise page (1). the top is the toolbar, the lower left is the function option, and the lower right is the detailed setting option. In the targetWebBefore the server performs a stress test, make necessary settings.

Figure 1

1. In the "Settings" function settings (2), one isStress Level(Threads) is specified hereProgramThe number of threads used in the background for requests is equivalent to simulating the number of client connections. A more vivid way is to set the number of bombing threads. Generally, enter 500 ~ 1000, because the number of threads is set based on the local capacity. If you have sufficient confidence in your machine configuration, the higher the setting, the better the bombing effect.
To change the number of concurrent users, click the settings icon. If there are less than 100 users, you can directly set the stress level. To simulate more than 100 users, you must also set the stress multiplier. The basic formula is: Number of users (number of threads) = stress level * stress multiplier. To simulate 1,000 users, you can set the stress level to 100 and the stress multiplier to 10.

Figure 2

2. In "test run time", specify the duration of a stress test, which can be divided into days, hours, minutes, And seconds. Set the duration based on the actual situation!

3. The rest of the options are not very important. Here we will not waste any effort. You can try setting them yourself.

Iii. Stress Testing

After the introduction of the tool, we will prepare the following conditions: here we will discuss with a friend about the test, he is a single machine online, the machine configuration is CPU: athlon xp2500 +, memory 512 MB, hard disk 80 GB, etc, the machine configuration is not bad. He installed IIS on the machine and set up an externalWebServer,WebIn the service, the program is "net 7.0. I used the stress testing tool to test this server.

Step 1: Right-click the tool and select Add to add a new test project: new script, in the master option, enter the IP address of the server to be tested. SelectWebConnection method. Select "get" for "Mode" and "path" for "test ".WebPage path. Enter/index. asp, which is the homepage file of the dynamic network (3 ).

Figure 3

Step 2: In the "Settings" function settingsStress Level(Threads) set the number of threads to 1000. After that, click the gray triangle button in the tool to perform the test (4 ). After the test is completed, wait for a friend to send the task manager and connection view!

Figure 4

After the attack starts, you can see from the task manager that the CPU usage has reached 100%, and the loss rate has reached the maximum (5 ). Run the netstat-An command in the CMD window. You can see that my IP address is connected to port 80 on a friend's server (6 ). And itsWebThe website can no longer be opened, prompting too many users to connect, achieving the same purpose as the D. o.s attack.

Figure 5

Figure 6

Imagine how to use multiple bots to operate on a serverWebStress testing is a disaster tolerance for this server, so friends must consider it carefully before using it.

Analyze test results
You can click the reports icon on the toolbar to view the generated report. This generates a new tab corresponding to the script tab. Reports are stored in an outline view. First, click "result codes" in your report. This will give you a quick impression on whether there is any problem in this test. If you see the statusCodeIf it is not 200, you may need to check what is wrong. The common problems include the signature and incorrect URL path.

Click overview. You will see a brief and quick analysis of this test activity. From the perspective of ASP technology, request per second is a key value that requires in-depth analysis. The higher the value, the better. Generally, if you cannot determine a specific goal from the Use report and budget, you can set ASP's requests per second value to higher than 30, of course, this ASP does not connect to the database or use other components. It is foreseeable that connecting to the database will increase the burden on the program.

Although the request per second counter is included in was by default, you may want to add other counters. You can click the perf counters icon and add counter to add other counters. A particularly useful counter is ASP requests queued, which is often the key to identifying a blocked or long-lived page or component. Resources for analyzing ASP performance include:

· Tuning Internet Information Server Performance

· Navigating the maze of settings for Web server performance optimization

· IIS 4 Resource Kit

Factors Affecting Performance and testability
Server composition, database access, and other factors will greatly reduce the ASP request per second value. Different configuration options also play different roles. Here I want to point out several common factors:

· If you are accessing a database, do you have a connection pool? For more information about the connection pool, see pooling in the Microsoft Data Access Components.

· Are you using ASP session variables to store the status? Session variables will soon affect testability. They need server resources, and if you want to increase the number of machines to expand the performance, they will be blocked because the session is connected to a specific machine. Stateless is the method to maximize scalability. For more information about session substitution, see this article.Article: HOWTO: persisting values without session.

· Do you store Visual Basic components in the session state? Remove them now. The Visual Basic object in the session will cause thread relevance and interfere with the thread pool of IIS. This is a complex topic, but the experience is: do not store single-threaded apartment (STA) objects in the session. If you need to keep objects in the session, they should be marked as "both", and you need to aggregate these free threads into a set by yourself. Active Template Library (ATL) can create such a monster.

· Is your network program restricted to running in its own memory? In fact, we recommend process protection. However, if you need to squeeze out some extra performance, running your network program in the process will save some overhead of the Cross process set.

· When Microsoft Transaction Server (MTS) components are involved, if the component runs as a server package rather than a library package, there will be significant performance differences. A common suggestion is to set the network program to run in its own memory space, and then run the MTS component in the library package.

Simulate multiple users
I will briefly introduce how to simulate multi-user requests in was. You need to do two things:

1. Change concurrent connections on the settings panel.

2. Create users in users at least to create more users than you specified in concurrent connections.

To change the number of concurrent users, click the settings icon. If there are less than 100 users, you can directly set the stress level. To simulate more than 100 users, you must also set the stress multiplier. The basic formula is: Number of users (number of threads) = stress level * stress multiplier. To simulate 1,000 users, you can set the stress level to 100 and the stress multiplier to 10.

If you try to run the script before setting enough users, you will get a warning. Click the Users icon to modify the number of users. You will see a default group in the window on the right. Double-click the default group to expand your user list. If anonymous access is allowed, simply enter the code of the new user and click Create.

Run the test that requires signed logon.
If you want to run the page that requires signed logon, you need to create a suitable user name and password so that was can be used at runtime. This is also set in users. You can remove the current user list by removing all from the beginning, and then add the user you need. You can also choose to import the user name and password from the text file.

However, you must ensure that these users have valid accounts and can access the IIS server. If you are using a basic user account, you can test this account by submitting a certificate in your browser and writing a request in a text file. servervariables ("auth_user") is helpful. The modified ASP code will look like this:

Ots. writeline ("session ID:" & session. sessionid & CHR (32 )&_
"Time:" & CSTR (now () & "auth User:" & CHR (32) & request. servervariables ("auth_user "))
Tips for using was
At the end, I will provide some tips and some experience to summarize:

· Adjust the storage of log files on your website because the file will increase rapidly (see the IIS Documentation)

· You can track was activities by setting the DWORD of hkey_local_machinesoftwaremicrosoftwassessiontrace in the Registry to 1.

· If your was report shows an error, check the event log, browse your page in the tool's external browser, and then check the server's log: winntsystem32logfilesw3svci

· If your testing client machine's processor usage exceeds % 85, you may need to add more testing clients

· More interesting topics will appear in was documents: page groups, query strings, cookies, web application stress object model and Active Server Page client (this will allow you to remotely control the test client through web)

Please note that this is a tool without technical support and sends your issue to the You can search for common problems on the Web application stress tool. You can also program the tool and reference the object model on the same website.

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: 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.