In IIS7, what happens between Application_BeginRequest and Application_PreRequestHandlerExecute?

I have some time-stamped trace instructions in an ASP.Net IIS application that receives a lot of traffic. I have trace statements at the end of Application_BeginRequest and the beginning of Application_PreRequestHandlerExecute in my Global.asax. Sometimes there is a big delay between the end of BeginRequest and the start of PreRequestHandlerExecute, i.e. more than 5 seconds.

What happens in the HttpRequest life cycle between these two method calls that can take so long? This is IIS7 on Windows Server 2008.

Thanks.

+6
source share
1 answer

If BeginRequest has already succeeded and the delay before PreRequestHandlerExecute, you may need to register a stream identifier. If it is different, you suffer from the flexibility of the ASP.NET thread.

The reason for this may be the use of sessions. ASP.NET uses read-write lock on HttpContext.Current.Session. If you write this variable, all other requests with the same session will not be executed at the same time and will be queued .. NET uses the polling mechanism to check if the session lock is released.

I would also recommend the checken you created on Release, and that system.web/compilation/@debug = 'false'

+6
source share

All Articles