A Tech Log

December 1, 2008

ASP.NET Performance Checklist

Filed under: Development — adallow @ 11:31 pm
Tags: ,

Design Considerations

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

Threading

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

Resource Management

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

Pages

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

Server Controls

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

Data Binding

ms998596.checkbox(en-us,MSDN.10).gif Avoid using Page.DataBind.
ms998596.checkbox(en-us,MSDN.10).gif Minimize calls to DataBinder.Eval.

Caching

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

State Management

ms998596.checkbox(en-us,MSDN.10).gif Store simple state on the client where possible.
ms998596.checkbox(en-us,MSDN.10).gif Consider serialization costs.

Application State

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

Session State

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

View State

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

HTTP Modules

ms998596.checkbox(en-us,MSDN.10).gif Avoid long-running and blocking calls in pipeline code.
ms998596.checkbox(en-us,MSDN.10).gif Consider asynchronous events.

String Management

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

Exception Management

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

COM Interop

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

Data Access

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

Security Considerations

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

Deployment Considerations

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

Patterns and Practices home

Advertisements

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a free website or blog at WordPress.com.

%d bloggers like this: