I am experiencing slow response times on a web server hosting several asp.net applications. I do not precompile my apps so I understand that the first request to an application will take some time to load (5 to 10 secs). However, if an application has been idle for some time (20-30 minutes) the response is still slow even though I have set the “Idle Timeout” to 0 for the app pool in IIS 7.5. Therefore, I am considering writing a Windows service that will send requests to the individual apps every 10 minutes to keep them alive. My question is how does the JIT compiler handle subdirectories in an app. Does the JIT compiler compile all code for an app when you request a single page or does it do just enough to process the current request?
So when I write the Windows service can I just send a request to a single page in the app or do I need to send a request to a page in each subdirectory as well?
Thanks.
The model ASP.NET generally uses creates separate assemblies for the contents of the App_Code directory as well as the global.asax file, and then compiles all of the .aspx pages in each directory into a separate assembly (upon request).
User controls and Master Pages are also typically compiled independently from .aspx pages. I’m assuming you’re using the “Updateable” option when you deploy. In that case
deployment time
So given the above, you’d have to make requests to at least one page in each folder, to keep the site “hot”.
If you’ve used the “Fixed Names” option then you’ll have many more assemblies but this option is also the best for when you want to be able to update the .aspx files. But be sure to test your site and compile performance on the production server.