1

We have IIS version 6.2 for running an ASP.net application. We have a application pool for this web application. The .net framework version is "4.0". "Startmodus" is "AlwaysRunning".

Why is the first access of a user always slow?

I found several questions releated to this topic but I cannot see why "AlwaysRunning" is not helping here.

Application Pool Settings

Is it a good idea to create a powershell script accesssing the web application every 15 minutes in order to avoid this "IIS sleep mode"?

Matthias
  • 1,386
  • 3
  • 24
  • 59
  • Maybe this can help you http://stackoverflow.com/questions/7387123/how-to-warm-up-an-asp-net-mvc-application-on-iis-7-5 – Aristos May 19 '14 at 08:13
  • I am using http://uptimerobot.com/ now. It Triggers a request every 15 minutes. But I cannot believe that it is that complicated to solve it in IIS by one or two Settings. – Matthias May 19 '14 at 08:19
  • 1
    Usually sites that have some users, did not fall on this category. You site is a rare case. If you have for example 10-20 public sites under a pool, the crawler never allow that to happen. If you have a private site, under one pool, then is happends – Aristos May 19 '14 at 10:09

3 Answers3

5

a little late to the party, but it seems what you need is either set the Idle Time-out to zero (default is 20) means every 20 minutes the application pool will be restarted. Source

Also there is a tag in web.config, to tell iis to send a fake request to you app at start up , to make sure you app is completley initialized :

<applicationInitialization
   remapManagedRequestsTo="Startup.htm"
   skipManagedModules="true" >
   <add initializationPage="/default.aspx" />
</applicationInitialization>

Source

Muhammad Naderi
  • 3,090
  • 3
  • 24
  • 37
  • The link `http://patrickdesjardins.com/blog/iis-8-0-application-initialization-for-fast-startup-everytime` is very useful. thanks. – Mahdi Ataollahi Jul 10 '19 at 11:24
3

I had to install the 'Application Initialization' feature of IIS (only IIS 8+ I think).

https://www.iis.net/configreference/system.webserver/applicationinitialization.

Furthermore I had to set following settings:
App pool: StartMode always running
The page: Preload enabled

And finally recycle the app pool for the changes to take effect.

Kobbe
  • 809
  • 5
  • 16
0

AlwaysRunning means that it won't shut down if it's idle.

So, you need to configure Auto Start as well:

  1. In IIS Manager, click computer name in the Connection pane.
  2. Switch to Features View if the view is not active.
  3. Double-click Configuration Editor in the Management section of the Features View.
  4. Click the down-arrow for the Section field, expand system.applicationhost, and then click application pools.
  5. Click (Collection) and then click eclipses (…) next to the field that shows the count.
  6. In the Collection Editor, select the application pool for which you want to configure the startMode attribute.
  7. In the Properties window at the bottom, set the value of autoStart attribute to True.

Complete info here

Uriil
  • 11,948
  • 11
  • 47
  • 68