I've got some tracing statements with timestamps on an ASP.Net IIS application that gets a lot of traffic. I've got trace statements at the end of Application_BeginRequest and the beginning of Application_PreRequestHandlerExecute in my Global.asax. Occasionally there is a big delay between the end of BeginRequest and the start of PreRequestHandlerExecute, i.e. more than 5 seconds.
What is going on in the lifecycle of an HttpRequest between these two method calls that could be taking so long? This is IIS7 on Windows Server 2008.
Thanks.
If BeginRequest has already happend and the delay is before PreRequestHandlerExecute, you might want to log the thread id. If it is different, you suffer from ASP.NET thread agility.
A reason for this to happen can be the use of sessions. ASP.NET uses a reader-writer lock on the HttpContext.Current.Session. If you write to this variable, all the other request with the same session cannot run concurrently and are parked in a queue. .NET uses a polling mechanism to check whether the session lock is released.
I would also recommend checken that you've build on Release and that system.web/compilation/@debug = 'false'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With