ASP.NET 2.0 Performance Guidelines - HTTP Modules
From Guidance Share
- J.D. Meier, Srinath Vasireddy, Ashish Babbar, John Allen, and Alex Mackman
[edit]
Avoid long-running and blocking calls in pipeline code
Avoid placing long-running code in an HTTP module for the following reasons:
- ASP.NET pages are processed in a synchronous fashion.
- HTTP modules typically use synchronous events.
Long-running or blocking code reduces the concurrent requests that can run in ASP.NET.
[edit]
Consider Asynchronous Events
For every synchronous event, there is also an asynchronous version of that event. Although asynchronous events still logically block the request for the duration of the asynchronous work, they do not block the ASP.NET thread.
References
- For more information on HTTP modules, see the MSDN Magazine article, "ASP.NET Pipeline: Use Threads and Build Asynchronous Handlers in Your Server-Side Web Code," at http://msdn.microsoft.com/msdnmag/issues/03/06/threading/default.aspx.