Pindakaas
Pindakaas

Reputation: 4439

asp.net site takes a while to load after restart

I have an asp.net 2.0 website running on IIS 7.5. The default page page_load event takes a while to load after a restart in iis 7.5. In the bottom it says "waiting for....".
If I hit the default page after without restarting iis it loads very quickly. I cant really post the exact code here. What could be the cause? Is it recompiling the whole website? If so how can I prevent this?

Upvotes: 3

Views: 407

Answers (2)

Lawrence Johnson
Lawrence Johnson

Reputation: 4043

You can prevent it by increasing the length of the application pool's life cycle. In IIS, go the Application Pool's folder and select the pool for your site. Right click, Advanced Settings..., locate Idle Time-out Minutes under Process Model and increase the time to match use of your site. IE: if you average one visitor per hour, then 60 minutes will keep it alive.

The first time after an IIS Reset it will always do that at least once though.

Another thing you can do is get a faster computer, but you'll always have more hang the first time than others.

Upvotes: 0

David
David

Reputation: 73604

This is normal. It is, indeed, recompiling the site. There are several things that can cause a JIT recompile on an ASP.NET site.

More information can be found here. (It's an older version of the documentation. I chose the version of the documentation that is in line with the version of the Frameworkyou specified, but it's the same in all versions.)

Upvotes: 4

Related Questions