views:

32

answers:

1

I'm using ASP.NET MVC 2. When in Debug mode, there is a very consistent 5-10 second delay on every other request to the server before HttpApplication_BeginRequest() is hit in Global.asax

It happens exactly every other request. In Release mode it is fast always but it's causing me problems testing things in Debug mode. I looked at the call stack but the only thing before the HttpApplication_BeginRequest() is "External Code" so I can't tell what's happening. How can I find out what is introducing this lag in the pipeline? Thanks.

+1  A: 

Doesn't ASP.NET recycle the App Domain every 15 hits? I once had a situation where I realised that due to using wildcard IIS mapping, all resource calls on the page (i.e. for script, images etc.) were going via the ASP.NET httphandler and thus contributing to the 15-hit count. Does that make sense?

James McCormack
Well this is possible, but I am getting this behavior on 1 of 2 hits. For example, I have a grid with pagination. If I click 'next page' it is very consistent - first is instant, then it takes a few seconds, then instant again, then it takes a few more seconds, and so on. This happens even if I page randomly through the grid, not just sequentially..
Smith
Maybe add a logging function to Application_End in global.asax, then you can see if the App Domain is being recycled for sure? Also, you can check the server event log to see if there is a problem like the app crashing for some reason. Also try adjusting the `numRecompilesBeforeAppRestart` value in the `machine.config` `compilation` section.
James McCormack