Search code examples
asp.net-mvciisapplication-poolrecycleuser-inactivity

application compiles every 15 minutes


I am using ASP.Net4 MVC2 for my application. The first person using the application usually experiences a long wait before the application responds. After that the application is pretty responsive. If the application is idle for 15 minutes, the same person or the next person using the application will experience long wait again. It looks like the application compiles after being idle for 15 minutes. Can someone tell me where I should look to trouble shoot the problem? Thanks.


Solution

  • It is almost certainly the case that what you are experiencing is app pool recycling. It's true it takes some time to re-initialize after the pool has been recycled, but it shouldn't take all that long. How long is a "long wait"? A second? Several? In IIS you can configure how regularly your app pool recycles. For IIS 7, right-click on your app pool and choose "Advanced Settings" then look at "Idle Time-out". You may consider increasing this value. (Or set to 0 to disable completely.)