Hello,
We have a strange problem on our Windows 2008 R2, IIS 7.5 webserver. Recently we've started on updating some of our website's to .NET 4.0, but we noticed that some of them load very very slow at first requests after the recycling of the application pool, it takes 1-2 minutes for the page to load if that happens. Any requests after that are normal.
After some testing and researching, we noticed that not all website's have that problem. First of all, none of our old .NET 1.1 website's have the problem (which run on the same server). At first i thought that this problem existed with all .NET 4.0 website's we have, but that is not the case. Today i made a simple ASP.NET project with nothing extra in it, just the sample Web Forms project of Visual Studio. When i uploaded it to our webserver, it didn't have that problem. So i thought that the problem was in our code, so i started adding things to the test website, like data retrieval from a database, etc. But the website kept being fast, even at first requests.
After a while i deleted all files of the test website and copied all files of a website which has the slow performance problem, into the folder where the test website was. I didn't change any settings in IIS of the test website. The copied website was fast at first requests, just like the test website. So i started thinking that it had to be an application pool problem and i compared the settings of the 2 application pools. I noticed that the settings were identical.
Then i changed the application pool of the fast test website, to that of the slow website and tried again. The test website then also was as slow as the other website, at first request. Then i changed it back to it's own application pool and it was fast again. After that, i changed the application pool of the slow website, to that of the fast test website. Now the slow website was fast again.
So my question is, how can this happen? How can one application pool become slower than the other application pool with identical settings, even after restarting both of them and is there a way to fix/prevent it? Once an application pool becomes slow, it
does not become fast again, even with stopping and starting it.
I made sure to recycle the application pools before every test i did, so that all tests were 'first requests'.