Condividi tramite


Checklist: ASP.NET Performance

 

Retired Content

This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

patterns & practices Developer Center

Improving .NET Application Performance and Scalability

J.D. Meier, Srinath Vasireddy, Ashish Babbar, and Alex Mackman
Microsoft Corporation

May 2004

Related Links

Home Page for Improving .NET Application Performance and Scalability

Send feedback to Scale@microsoft.com

patterns & practices Library

How to Use This Checklist

This checklist is a companion to Chapter 6, "Improving ASP.NET Performance"

Design Considerations

Check Description
Ff647706.checkbox(en-us,PandP.10).gif Consider security and performance.
Ff647706.checkbox(en-us,PandP.10).gif Partition your application logically.
Ff647706.checkbox(en-us,PandP.10).gif Evaluate affinity.
Ff647706.checkbox(en-us,PandP.10).gif Reduce round trips.
Ff647706.checkbox(en-us,PandP.10).gif Avoid blocking on long-running tasks.
Ff647706.checkbox(en-us,PandP.10).gif Use caching.
Ff647706.checkbox(en-us,PandP.10).gif Avoid unnecessary exceptions.

Threading

Check Description
Ff647706.checkbox(en-us,PandP.10).gif Tune the thread pool by using the formula to reduce contention.
Ff647706.checkbox(en-us,PandP.10).gif Consider minIoThreads and minWorkerThreads for burst load.
Ff647706.checkbox(en-us,PandP.10).gif Do not create threads on a per-request basis.
Ff647706.checkbox(en-us,PandP.10).gif Avoid blocking threads.
Ff647706.checkbox(en-us,PandP.10).gif Avoid asynchronous calls unless you have additional parallel work.

Resource Management

Check Description
Ff647706.checkbox(en-us,PandP.10).gif Pool resources.
Ff647706.checkbox(en-us,PandP.10).gif Explicitly call Close or Dispose on resources you open.
Ff647706.checkbox(en-us,PandP.10).gif Do not cache or block on pooled resources.
Ff647706.checkbox(en-us,PandP.10).gif Know your application allocation pattern.
Ff647706.checkbox(en-us,PandP.10).gif Obtain resources late and release them early.
Ff647706.checkbox(en-us,PandP.10).gif Avoid per-request impersonation.

Pages

Check Description
Ff647706.checkbox(en-us,PandP.10).gif Trim your page size.
Ff647706.checkbox(en-us,PandP.10).gif Enable buffering.
Ff647706.checkbox(en-us,PandP.10).gif Use Page.IsPostBack to minimize redundant processing.
Ff647706.checkbox(en-us,PandP.10).gif Partition page content to improve caching efficiency and reduce rendering.
Ff647706.checkbox(en-us,PandP.10).gif Ensure pages are batch compiled.
Ff647706.checkbox(en-us,PandP.10).gif Ensure debug is set to false.
Ff647706.checkbox(en-us,PandP.10).gif Optimize expensive loops.
Ff647706.checkbox(en-us,PandP.10).gif Consider using Server.Transfer instead of Response.Redirect.
Ff647706.checkbox(en-us,PandP.10).gif Use client-side validation.

Server Controls

Check Description
Ff647706.checkbox(en-us,PandP.10).gif Identify the use of view state in your server controls.
Ff647706.checkbox(en-us,PandP.10).gif Use server controls where appropriate.
Ff647706.checkbox(en-us,PandP.10).gif Avoid creating deep hierarchies of controls.

Data Binding

Check Description
Ff647706.checkbox(en-us,PandP.10).gif Avoid using Page.DataBind.
Ff647706.checkbox(en-us,PandP.10).gif Minimize calls to DataBinder.Eval.

Caching

Check Description
Ff647706.checkbox(en-us,PandP.10).gif Separate dynamic data from static data in your pages.
Ff647706.checkbox(en-us,PandP.10).gif Configure the memory limit.
Ff647706.checkbox(en-us,PandP.10).gif Cache the right data.
Ff647706.checkbox(en-us,PandP.10).gif Refresh your cache appropriately.
Ff647706.checkbox(en-us,PandP.10).gif Cache the appropriate form of data.
Ff647706.checkbox(en-us,PandP.10).gif Use output caching to cache relatively static pages.
Ff647706.checkbox(en-us,PandP.10).gif Choose the right cache location.
Ff647706.checkbox(en-us,PandP.10).gif Use VaryBy attributes for selective caching.
Ff647706.checkbox(en-us,PandP.10).gif Use kernel caching on Microsoft® Windows Server™ 2003.

State Management

Check Description
Ff647706.checkbox(en-us,PandP.10).gif Store simple state on the client where possible.
Ff647706.checkbox(en-us,PandP.10).gif Consider serialization costs.

Application State

Check Description
Ff647706.checkbox(en-us,PandP.10).gif Use static properties instead of the Application object to store application state.
Ff647706.checkbox(en-us,PandP.10).gif Use application state to share static, read-only data.
Ff647706.checkbox(en-us,PandP.10).gif Do not store single-threaded apartment (STA) COM objects in application state.

Session State

Check Description
Ff647706.checkbox(en-us,PandP.10).gif Prefer basic types to reduce serialization costs.
Ff647706.checkbox(en-us,PandP.10).gif Disable session state if you do not use it.
Ff647706.checkbox(en-us,PandP.10).gif Avoid storing STA COM objects in session state.
Ff647706.checkbox(en-us,PandP.10).gif Use the ReadOnly attribute when you can.

View State

Check Description
Ff647706.checkbox(en-us,PandP.10).gif Disable view state if you do not need it.
Ff647706.checkbox(en-us,PandP.10).gif Minimize the number of objects you store in view state.
Ff647706.checkbox(en-us,PandP.10).gif Determine the size of your view state.

HTTP Modules

Check Description
Ff647706.checkbox(en-us,PandP.10).gif Avoid long-running and blocking calls in pipeline code.
Ff647706.checkbox(en-us,PandP.10).gif Consider asynchronous events.

String Management

Check Description
Ff647706.checkbox(en-us,PandP.10).gif Use Response.Write for formatting output.
Ff647706.checkbox(en-us,PandP.10).gif Use StringBuilder for temporary buffers.
Ff647706.checkbox(en-us,PandP.10).gif Use HtmlTextWriter when building custom controls.

Exception Management

Check Description
Ff647706.checkbox(en-us,PandP.10).gif Implement a Global.asax error handler.
Ff647706.checkbox(en-us,PandP.10).gif Monitor application exceptions.
Ff647706.checkbox(en-us,PandP.10).gif Use try/finally on disposable resources.
Ff647706.checkbox(en-us,PandP.10).gif Write code that avoids exceptions.
Ff647706.checkbox(en-us,PandP.10).gif Set timeouts aggressively.

COM Interop

Check Description
Ff647706.checkbox(en-us,PandP.10).gif Use ASPCOMPAT to call STA COM objects.
Ff647706.checkbox(en-us,PandP.10).gif Avoid storing COM objects in session state or application state.
Ff647706.checkbox(en-us,PandP.10).gif Avoid storing STA components in session state.
Ff647706.checkbox(en-us,PandP.10).gif Do not create STA components in a page constructor.
Ff647706.checkbox(en-us,PandP.10).gif Supplement classic ASP Server.CreateObject with early binding.

Data Access

Check Description
Ff647706.checkbox(en-us,PandP.10).gif Use paging for large result sets.
Ff647706.checkbox(en-us,PandP.10).gif Use a DataReader for fast and efficient data binding.
Ff647706.checkbox(en-us,PandP.10).gif Prevent users from requesting too much data.
Ff647706.checkbox(en-us,PandP.10).gif Consider caching data.

Security Considerations

Check Description
Ff647706.checkbox(en-us,PandP.10).gif Constrain unwanted Web server traffic.
Ff647706.checkbox(en-us,PandP.10).gif Turn off authentication for anonymous access.
Ff647706.checkbox(en-us,PandP.10).gif Validate user input on the client.
Ff647706.checkbox(en-us,PandP.10).gif Avoid per-request impersonation.
Ff647706.checkbox(en-us,PandP.10).gif Avoid caching sensitive data.
Ff647706.checkbox(en-us,PandP.10).gif Segregate secure and non-secure content.
Ff647706.checkbox(en-us,PandP.10).gif Only use Secure Sockets Layer (SSL) for pages that require it.
Ff647706.checkbox(en-us,PandP.10).gif Use absolute URLs for navigation.
Ff647706.checkbox(en-us,PandP.10).gif Consider using SSL hardware to offload SSL processing.
Ff647706.checkbox(en-us,PandP.10).gif Tune SSL timeout to avoid SSL session expiration.

Deployment Considerations

Check Description
Ff647706.checkbox(en-us,PandP.10).gif Avoid unnecessary process hops.
Ff647706.checkbox(en-us,PandP.10).gif Understand the performance implications of a remote middle tier.
Ff647706.checkbox(en-us,PandP.10).gif Short-circuit the HTTP pipeline.
Ff647706.checkbox(en-us,PandP.10).gif Configure the memory limit.
Ff647706.checkbox(en-us,PandP.10).gif Disable tracing and debugging.
Ff647706.checkbox(en-us,PandP.10).gif Ensure content updates do not cause additional assemblies to be loaded.
Ff647706.checkbox(en-us,PandP.10).gif Avoid XCOPY under heavy load.
Ff647706.checkbox(en-us,PandP.10).gif Consider precompiling pages.
Ff647706.checkbox(en-us,PandP.10).gif Consider Web garden configuration.
Ff647706.checkbox(en-us,PandP.10).gif Consider using HTTP compression.
Ff647706.checkbox(en-us,PandP.10).gif Consider using perimeter caching.

patterns & practices Developer Center

Retired Content

This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

© Microsoft Corporation. All rights reserved.