First request after a while always slow - ASP.NET MVC / IIS 8.5 / Windows Server 2012 R2 VPS

32,377

The problem is, you need to install the IIS feature Application Initialization. Then it should work with your configuration.

The image is from Rick Strahl's blog:

IIS Feature

Also remember to set:

  • Start Mode to AlwaysRunning on the application pool
  • Preload Enabled to True on the website level

You can set this settings without the Application Initialization Module be installed, but then they won't have any effect.

More Information here.

Share:
32,377

Related videos on Youtube

michalstanko
Author by

michalstanko

Passionate freelance web developer from Bratislava, Slovakia. JavaScript has been my #1 language of choice for many years. Recently I've been working mainly with Angular/TypeScript.

Updated on September 18, 2022

Comments

  • michalstanko
    michalstanko over 1 year

    I'm hosting a low-traffic ASP.NET MVC 5 application on a VPS with Windows Server 2012 R2 / IIS 8.5, with 1 GB of RAM.

    My problem is that the first request after some time without any requests always gets a slow response - around 1.5 seconds according to Chrome Dev Tools. Subsequent refresh requests/responses only take about 45 ms.

    I already did set Start Mode to AlwaysRunning on the application pool, and Preload Enabled to True on the website level, but it had absolutely no effect. Even if there are no changes/uploads whatsoever, after some time passes, with the next request it takes 1.5 s to get a response.