Article 4 of the 28 code of ASP performance optimization proposed by Microsoft

Source: Internet
Author: User

Tip 22: Try to replace response. Redirect with server. Transfer.

Response. Redirect allows the browser to request another page. This function is often used to redirect users to a logon or error page. Because redirection forces a new page request, the result is that the browser must go to the Web server twice, and the Web server must process one more request. IIS 5.0 introduces a new function server. Transfer, which transfers execution to another ASP page on the same server. In this way, unnecessary browser-web-server round-trips are avoided, which improves the overall system performance and shortens the user response time. Check "New Direction" in "redirection", which should be server. Transfer and server. Execute.

See leveraging ASP in IIS 5.0 for a complete list of new functions of IIS 5.0 and ASP 3.0.

Tip 23: Use a backslash in the directory URL

A related technique is to ensure that the slash (/) is used in the URL pointing to the directory (/). If you omit the slash, the browser will send a request to the server, just to tell the server that it is in the request directory. The browser sends a second request and attaches the Slash to the end of the URL, the server can respond with the default document or directory list of this directory (if no default document is available and directory browsing is enabled. Adding a slash can save the first and useless return. To facilitate reading, you can omit the slash in the display name.

For example, write:

<A href =? Http://msdn.microsoft.com/workshop? Title =? Msdn Web
Workshop?> Http://msdn.microsoft.com/workshop </a>

This also applies to the URL pointing to the home page on the web site: Use the following: <a href =? Http://msdn.microsoft.com/?>, Instead of using <a href =? Http://msdn.microsoft.com?>.

Tip 24: Avoid using server Variables

Accessing server variables will make the web site send a special request to the server and collect all server variables, not just the variable you requested. This is similar to finding a file in a folder in a moldy attic. When you want to find the file, you must go to the attic and find the folder before you can find the file. When you request server variables, the situation is the same-when you request server variables for the first time, the performance will be affected. Subsequent requests to other server variables do not affect performance.

Never access a non-limited request object (for example, request ("data ")). For projects that are not in request. Cookies, request. Form, request. querystring, or request. clientcertificate, request. servervariables is called implicitly. The request. servervariables set is much slower than other sets.

Tip 25: upgrade to the latest and best

System components are constant. We recommend that you upgrade them to the latest and best configuration. It is recommended to upgrade to Windows 2000 (therefore, you should also upgrade to IIS 5.0, ADO 2.5, MSXML 2.5, Internet Explorer 5.0, VBScript 5.1, and JScript 5.1 ). On a multi-processor computer, implementing IIS 5.0 and ADO 2.5 can significantly improve performance. In Windows 2000, ASP can be well extended to four or more processors, while in IIS 4.0, ASP can not expand beyond two processors. In the ApplicationProgramScript used inCodeAnd the more ado, the more performance will be improved after the upgrade to Windows 2000.

If you cannot upgrade to Windows 2000, you can upgrade to the latest version of SQL Server, ADO, VBScript, JScript, MSXML, Internet Explorer, and NT 4 service packs. Both improve performance and reliability.

Tip 26: optimize Web Servers

There are a variety of IIS optimization parameters to improve site performance. For example, for IIS 4.0, we often find that adding the ASP processorthreadmax parameter (see the IIS documentation) can significantly improve performance, especially when we tend to wait for backend resources (such as databases) or other intermediate products (such as screen clicks) on the site. In IIS 5.0, you may find that enabling ASP thread gating is more efficient than searching for an aspprocessorthreadmax, which is well known.

For more information, see optimizing IIS below.

The Optimal Configuration Setting depends on (some of the factors) the application code, the system hardware that runs, and the client workload. The only way to find the best settings is to perform a performance test, which we will discuss in the next tip.

Tip 27: perform a performance test

As we have mentioned earlier, performance is a feature. If you want to improve the performance of your site, set a performance goal and gradually improve it until it reaches the goal. No, no performance tests. It is usually too late to make necessary structural adjustments at the end of the project, and your customers will be disappointed with this. Perform performance tests as part of your daily tests. You can perform performance tests on individual components, such as for ASP pages or COM objects, or test the website as a whole.

Many people use a single browser to request pages to test the performance of web sites. This will give you a feeling that the site's response capabilities are good, but this does not actually tell you how the site's performance is under load conditions.

Generally, to accurately test performance, you need a dedicated test environment. This environment should include hardware, its processor speed, number of processors, memory, disk, network configuration, and other aspects similar to the hardware in the production environment. Second, you must specify the client workload: the number of simultaneous users, the frequency of requests they send, and the type of pages they click. If you do not have the actual usage data of the site, you must estimate the usage. Finally, you need a tool that can simulate the expected client workload. With these tools, you can begin to answer questions such as "How many servers do I need if I have n simultaneous users ?" And so on. You can also find out the cause of the bottleneck and optimize it accordingly.

Some good web load testing tools are listed below. Microsoft Web application stress (was) Toolkit is recommended. Was allows you to record test scripts and simulate hundreds or thousands of users to access the Web server. Was reports a lot of statistics, including the number of requests per second, response time distribution and error count. Was provides rich client interfaces and web-based interfaces, allowing you to perform remote testing.

Be sure to read the IIS 5.0 tuning guide.

Tip 28: Read resource links

Below are some excellent resource links related to performance. For more information, see developing scalable Web applications.

Resources

Optimize ASP scripts
Developing scalable Web Applications

Got any cache? Nancy Winnick cluts

Maximizing the performance of your Active Server Pages, by Nancy Winnick cluts

15 seconds: Performance Section

Enhancing Performance in ASP-Part I, by Wayne plourde

When is better worse? Weighing the technology trade-offs, by Nancy Winnick cluts

Speed and optimization resources, Charles Carroll

Optimize IIS

The art and science of Web Server tuning with Internet Information Services 5.0

Leveraging ASP in IIS 5.0, J. D. Meier

Tuning IIS 4.0 for high volume sites, by Michael Stephen son

Tuning Internet Information Server performance, by Mike Moore

Navigating the maze of settings for Web server performance optimization

Managing Internet Information Server 4.0 for performance, Hans hugli

ADO and SQL Server

Top Ten Tips: Accessing SQL through ADO and ASP, J. D. Meier

Improve the performance of your MDAC application, Suresh Kannan

Pooling in the Microsoft Data Access Components, co-authored by Leland ahlbeck and Don Willits

SQL Server: performance benchmarks and guides

Improving the Performance of Data Access Components with IIS 4.0, Leland ahlbeck

Microsoft Data Access Components (MDAC) and ActiveX Data Objects (ADO) Performance tips, Leland ahlbeck

Microsoft SQL Server 7.0 practical performance tuning and Optimization-the server perspective

Microsoft SQL Server 7.0 practical performance tuning and Optimization-the application perspective

Accessing recordsets over the Internet, Dino esposito

ASP Component and thread model

ASP Component guidelines, J. D. Meier

Q243548: info: Design Guidelines for VB components under ASP

Threading Models explained, by Nancy Winnick cluts

So happy together? Using ActiveX components with Active Server Pages, by Nancy Winnick cluts

Developing active server components with ATL, George Reilly

Agility in server components, by Neil Allain

Building high-performance middle-tier components with C ++, Jon Flanders

Active Server Pages and COM apartments, Don box

House of COM: Active Server Pages, Don box

House of COM: contexts, Don box

House of COM: Performance trade-offs of the Windows 2000 component execution environment, Don box

Building COM components that take full advantage of Visual Basic and scripting, Ivo salmre

Component Design Principles for MTS

Dictionary Components

Creating a page cache object, by Robert Coleridge

Abridging the dictionary object: The ASP team creates a lookup-Table object, Robert Carter

Caprock dictionary

Site Server Commerce Edition des a dictionary component

Session Status

Q175167: HOWTO: persisting values without sessions

Q157906: HOWTO: How to maintain state pages SS with VBScript

XML-based persistence behaviors fix web farm headaches, by Aaron skonnard

House of COM: stateless programming, Don box

Performance and scalability

Blueprint for building web sites using the Microsoft Windows DNA Platform

Server performance and scalability killers, by George Reilly

Microsoft Visual Studio scalability Center

Fitch & Mather stocks 2000

Tuning the fmstocks Application

High-performance Visual Basic apps, by Ken Spencer

Duwamish books, phase 4

Top Windows DNA performance mistakes and how to prevent them, Gary Geiger and Jon Pulsipher

Building from static HTML to high-performance web-farms, Shawn Bice

Tools

Microsoft Web application stress Tool

I can't stress it enough -- load test your ASP application, J. D. Meier

Windows DNA performance kit

Monitoring events in distributed applications using Visual Studio analyzer, Mai-lan tomsen

Bibliography

Professional Active Server Pages 3.0, wrox Press (especially Chapter 4: optimizing ASP performance, George Reilly, and Matthew James ).

Microsoft Internet Information Services 5.0 Resource Guide (with Windows 2000 Server resource kit), Microsoft press.

Microsoft Internet Information Server Resource Kit (for IIS 4.0), Microsoft press.

Programming distributed applications with COM and Microsoft Visual Basic 6.0, Ted Pattison, Microsoft press.

Share tive COM, Don box, Keith Brown, Tim Ewald, and Chris sells; Addison-Wesley.

Developing web usability: the practice of simplicity, by Jakob Nielsen, new riders.

ASP Web Site

Microsoft technet for IIS

Learnasp.com

4guysfromrolla.com

15seconds.com

Asptoday.com

Asp101.com

Asplists.com. Many professional email lists include:

Fast code!
ASP advanced
Not newbiestate Management
Scalability
Visual Basic Components
XML
C ++/ATL component building
Useit.com: Web availability

ASP Style

ASP best practices, by George Reilly

ASP quick lessons, by Charles Carroll

Planning for ASP, John Meade

ASP guidelines, by J. D. Meier

XML

Inside XML performance, Chris Lovett

Inside msxml3 performance, Chris Lovett


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.