Tutorials to .com

Tutorials to .com » Asp » Optimization » I can not exert enough pressure on it: for you ASP program for load testing

I can not exert enough pressure on it: for you ASP program for load testing

Print View , by: iSee ,Total views: 15 ,Word Count: 3550 ,Date: Fri, 17 Apr 2009 Time: 8:04 PM

JD Meier

September 27, 1999

Content
Introduction
Plot
Testing requirements
WAS testing tools introduced
Analysis of test results
Impact on performance and measurable factors
Simulation of multi-user
Operation need to sign certification test
skills WAS
Resources



Introduction
When we shifted from the traditional structure of CS application to the current popular Web space program, we found that we try to keep up with growing demand for testability and performance requirements. One of the biggest challenges is how to determine the procedures you can support up to how many users visit. How do you face this challenge? Set clear performance targets and use the Web stress testing tool is a good start.

This article will introduce you how to process the asp pressure testing will be introduced at the same time stress-testing tool for Microsoft - Web application Stress test Tool (WAS). In the next chapter, you will learn the basis of stress tests At the same time, will learn the necessary skills, through learning, you will be able to test results in accordance with a more effective test and modify your program.

Plot
Assuming you are going to release an expected 1,000 of the ASP program users. You clearly know that your program can handle at least two concurrent users visit, because you and your partners can click on the day of the ASP process will not be any problems. In the end you suspect that two users can accurately reflect your ability to process pressure. Of course, you can use the standard test methods (release of your program, and then look forward to the best results), but you still decided to pre-test the performance of your program. This is a good sign!

Testing requirements
In order to better test your ASP program, you first need to determine the procedures you need to face the future how much pressure. In short, the pressure or load can be decomposed into the following figures:

The minimum number of users. (This process is the minimum number of users, how many? Usually this value can be no day or week or month traffic - of course you can be decomposed into a more controllable numerical - hour visit to the volume)

The total number of concurrent users. (In the peak of what the situation worse? Plan accordingly. Hope that the pressure in the case of the normal work effectively.)

Peak value of the request. (Number per second, the need to have a ASP page? This may be in an ASP program to measure the user the ability to respond to the request when one of the most important factor.)

Decision procedure for your users and the number of concurrent users is usually a difficult task, but also in your program before actual use in the. Network program in particular. Even the local area network the procedures often have to face the problem of users increase, so the exact amount of the expected users will be difficult. When you do not know how to start, it is best to start from the basis of:

Internet issues to be considered:
Analysis of your existing IIS log. This value would imply that the actual probability of some

Your site will be more popular? One day there will be a popular site one million or more visits. Not be so popular? Well, a number of different hypothetical situation? Assuming you have more than 1000 user groups? You can add more hardware to solve the scalability problem? Alternatively, the structure of your program you will become a bottleneck?

What is the worst case scenario? Ask your friend the situation will happen?

Intranet need to consider the question:
Similarly, the analysis of your existing IIS log.

The ASP program is to give everyone the right to use? In the number of internal network machine? Your system administrator can tell you that the peak flow of the network anything?

This procedure targets specific users you? HR is Human Resources? The number of staff in the use of human resources?

The worst case scenario is what?

If you can not decide on an appropriate load in advance, then your program to determine the maximum would be the best choice for you. 10 If the user clicks, you can have in 1 the number of seconds to respond to the results of the ASP? 100 do? 1000 then? 10000 it? Records of your base. When you have been in use from the actual flow of your log shows that you are approaching your limit, you will not only will you know what the current limit, and you will have time to prepare a solution.

WAS testing tools introduced

Although there are a lot of pressure testing tools to choose from, but in this article, I will mainly focus on the WAS (is that the so-called Homer), WAS is the standard Microsoft web site stress testing tool. If you already are familiar with WebCat, you will find exciting WAS can easily import existing script WebCat. If you previously used InetMonitor, you will find exciting WAS is based on the GUI (using the command line for many of the users WebCat This will be a good additional features). Another advantage is that it is free of charge, one of my good friends used to say, "If it is free of charge, then that is me." In addition to its price advantage, this tool also provides a fully functional, but also constantly Upgrade update. Microsoft.com often to use it, so they will understand the importance of this tool.

But you do not have too much geography will be me, just to try their own. At the end of the article, I will provide a list of some of the pressure of third-party testing tools, you can decide what tools the election. The bottom line is you need a tool that can put your load on the ASP program, test it before release.

Start using WAS
I will teach you how to use this tool the first time to test an ASP page. I will introduce how to use a signed log of testing and multi-user concurrent access to the test, because these things will make a loss for beginners.

First of all you need to download and install this tool. You can be the link below the latest version

http://www.microsoft.com/technet/treeview/default.asp?url=/TechNet/itsolutions/intranet/downloads/webstres.asp. In this website there will be entry on the guidance of the tool, you can at any time go back and look at.

Below are the installation of a few points to note:

WAS should not be installed on your test target server, installed on other machines in order to ensure accurate test results.

WAS installed on the machines need to have ADO2. 1 or later. If not oledb32.dll version 2.10.3711 or above, ADO will be automatically installed WAS.

After installation you will have a complete log of the installation, the default will be \ Program Files \ Microsoft Web Application Stress Tool \ INSTALL.LOG.

If you have already installed the older version of WAS, updates the data file will be retained intact. WAS to use Access. Mdb file as a data storage file. WAS initial. Mdb package is WAS.mdb, can be found in the installation path.

WAS in the registry HKEY_LOCAL_MACHINE \ software \ Microsoft \ WAS store registration information.

Running of our new WAS installed, we create a simple ASP script as a test page. Create a new ASP page called the MyASPPage.asp, and then insert the following script:

MyASPPage.asp
<% @ Language = VBScript%>
<HTML>
<BODY>
<% CONST ForAppending = 8
set oFSO = server.CreateObject ( "Scripting.FileSystemObject")
'translate our virtual directory into a physical path
strFilePath = Server.MapPath (Request.ServerVariables ( "PATH_INFO"))
'grab the root of the virtual directory
strFilePath = left (strFilePath, (InstrRev (strFilePath, "\")))
strFilePath = strFilePath & "MyFile.txt"
'write out to the screen the full file path
Response.Write (strFilePath & "<BR>")
set oTS = oFSO.OpenTextFile (strFilePath, ForAppending, true)
oTS.writeline ( "Session Id:" & Session.SessionId & chr (32) & _
"Time:" & Cstr (now ()))
%>
</ BODY>
</ HTML>
This ASP script will insert a text file and its activities SessionId time, so that we can easily confirm whether or not we have the ASP page in the correct implementation. Once you are familiar with the tool, you can point to you the actual ASP page for the real test.

In the appropriate directory server to place your ASP page so that it can be anonymous access. We will try again later to visit the test signature, but now we need to run a basic test. Full URL path to the page you visit, including your server name. For example, a complete URL looks like http://MyServer/MyVirtualDirectory/MyASPPage.asp. Once you can successfully navigate your ASP page (be sure to check MyFile.txt this document, the document will be written procedures for the physical location of virtual directory), you can do the actual running of the WAS test.

When you first run the WAS when the following dialog box will appear:


Figure 1. Create a new script

While other options are very attractive, we are now before the election Manual. The future, you can Scripts from the menu or tool bar icon New Script access points to create a new script.

Welcome to the browser interface script. Window to the left of the tree structure of the script you listed. On the right hand side of the window you can modify your script.

The left hand side of the tree list window click New Script can activate browser scripting. In the Server input box enter the name of your server. Script Item in the first, select the GET as your action. In the PATH enter your ASP address for the virtual directory at the beginning. See Figure 2 are as follows:


Figure 2. Enter the URL in the Path field

At this time, you can point the arrow toolbar symbols Run Script to execute your script (be sure to ensure that you check the left side of the window at the right scripts). In a summary of the performance report, the script need to run about 1 minutes time.

Analysis of test results
You can look at the toolbar icon of the Reports generated by the report. This will result in a temporary phase and the Script tab of the new tab. Stored in a report in outline view. First of all, in your report the following points, Result Codes, this will give you a quick impression, the test whether there was any problem. If you do not see a status code 200, you may need to investigate what exactly is the problem, usually signed and include the URL path is incorrect.

Point Overview, you will see the activities of the test analysis of a brief fast. ASP from a technical point of view of, Request per Second, is a key value-depth analysis. This value is higher the better. Usually, if you can not use the report and budget from the decision of a specific target, you can enable ASP in Requests per Second values higher than 30, of course, the ASP is not connected to the database or to use other components. As can be expected to link the database will increase the burden of the procedure.

Although this Request per Second counter included in the WAS by default, you may wish to add other counters. You can point the Perf Counters icon Add Counter adopted to increase the point counter other. A special counter is useful ASP Requests Queued, this counter is often in identifying the presence of an obstruction or the long-term components of the pages or the key. Analysis of performance on the resources of ASP are:

Tuning Internet Information Server Performance

Navigating the Maze of Settings for Web Server Performance Optimization

IIS 4 Resource Kit

Impact on performance and measurable factors
Servers, database access, and other factors will greatly reduce the ASP's Request per Second value. Different configuration options will play a different role, I would like to point out, there are several factors:

If you access a database, do you have to do connection pooling? On the connection pool see the details of Pooling in the Microsoft Data Access Components.

Are you using the ASP Session variable to store the state? Session variables will soon affect testability. Server resources they need, and if you want to increase the performance machinery to expand, they would have hindered because Session is associated with a particular machine's. No state is to maximize the scalability of the method. Session alternatives on this article please refer to: HowTo: Persisting Values without Session.

Do you store in Session state has Visual Basic component? Remove them now. Session of Visual Basic objects will lead to the relevance and the thread can interfere with the fight against the IIS thread pool. This is a complex subject, but the experience of meeting the demands of its approach is: Do not store in the Session in the Single-threaded Apartment (STA) objects. If you need to retain in the Session object, they should be marked as "Both", and you need to aggregate these into a collection of free threads. Active Template Library (ATL) can create such a monster.

Procedures for your network is limited to run on its own memory space it? In fact, we recommend the process of protection. However, if you need to squeeze some extra performance, in the process of running your network will save some of the procedures set of cross-process overhead.

When it comes to the Microsoft Transaction Server (MTS) components, if the component is running as a server package and the package rather than the Treasury, then there will be a clear distinction between the performance. One proposal is to set up the usual procedures in the network of its own memory space to run, and then run the package in the MTS database components.

Simulation of multi-user situation
I will briefly introduce how to simulate WAS the case of multi-user request. You need to do two things:

1. In the Settings panel to change the Concurrent Connections.

2. In Users create a user, or at least more than you want to create Concurrent Connections specify the number of users.

To change the number of concurrent users, point Settings icon. If less than 100 users, you can set up direct Stress Level, to simulate more than 100 users, you must set the Stress Multiplier. The basic formula is: number of users (threads) = Stress Level * Stress Multiplier. If you want to simulate 1000 users, you can set the Stress Level and Stress Multiplier to 100 for 10.

If you do not provide sufficient user before trying to run the script, you will receive a warning. Users icon through the point you can modify the number of users, you will see a window to the right of the Default group by default. Double-click the Default user group to start your list, if you were allowed anonymous access, then you need to do is fill in a simple new user code then Create it.

Sign needed for the operation of the test signed
If you want to run need to sign in a signed page, then you need to create the appropriate user name and password so that WAS can be used at run time. This is also set in the Users. You can start on the Remove All to remove the current through the user list, and then add the users you need, you can also choose from a text file into a user name and password.

But in any case, the need to ensure that these users have a valid account, and they have access to IIS server. If you are using BASIC authentication basic user account, you can in your browser to submit a certificate to test this account, written in a text file Request.ServerVariables ( "AUTH_USER") This value will be of great help to the role. We modified the 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"))
WAS to use the techniques and tips
To conclude, I will provide some tips and tricks, and some experience:

Adjust your site's log file storage, because this document will increase rapidly (see IIS documentation)

By setting the registry in HKEY_LOCAL_MACHINE \ Software \ Microsoft \ WAS \ SessionTrace the DWORD to 1, you can debug a way to track the activities of WAS

WAS If your report shows an error, be sure to check the Event Log, for external use in the tool of your browser page, and then check the server log: \ WinNT \ system32 \ LogFiles \ W3SVCi

If your client machine to test the processor utilization rate of more than 85%, you may need to add more test client

Some of the more interesting topic of the document in the WAS to appear: Page Groups, Query Strings, Cookies, Web Application Stress Object Model and Active Server Page Client (this will let you have the ability to test the remote control through the Web client)

Please note that this is not a tool for technical support, send your question to webtool@microsoft.com. You can Web Application Stress Tool stained search the net number of common problems. You can also program the tool on the same site, a reference object model.

Resources
To obtain more information, WAS the tutorial Web site is a good place to go. Of course, be sure to read the WAS with the accompanying online help - in particular, called Web stress testing overview topic.

WebHammer. Do a ServerObjects procedures for testing network and server tools

LoadRunner. A Mercury Interactive tool to do stress tests can be used to the procedure foreseen in enterprise-class performance and the performance of the system

Enterprise Monitor. Produced by the company MediaHouse Software for surveillance, communications and restoration of your intranet and internet network

Extreme Soft's PerfMon. For Microsoft Transaction Server and the tools to do, from the performance monitoring in the MTS to provide direct surveillance.



JD Meier was born in the United States and the growth of the east coast. Since the attention to the recommendations of Greeley, he has become a development support engineer to focus on server-side components and the amount of MTS and ASP technology, Windows DNA applications.


Asp Optimization Articles


Can't Find What You're Looking For?


Rating: Not yet rated

Comments

No comments posted.