0

I have a fairly large website (~75k LoC), deployed two D2 v2 machines on Azure (7GiB RAM, 2 VCPU).

When I do a new build, I observe:

  • 1 of the CPUs going to 100%
  • This lasts for up to two minutes
  • Then Application_Start is fired

I'm trying to improve the time from when I publish to when Application_Start is fired as we publish regularly and it does cause some pain for visitors on the site.

Publishing the site consists of:

  • Publishing to folder (File System publish method)
  • Configuration Release
  • Delete all existing files checked
  • Precompile during publishing checked
  • Exclude files from App_Data folder checked
  • In advanced precompile settings, nothing is checked or selected except Do not merge in merge options
  • Zip the published folder up, upload to the VM's and unzip overwriting existing files (takes only a few seconds)

My question is:

  • Is the initial hold up in the realm of normal, or is there anything I can do to measure what it's doing?
  • Is there any settings I can change to improve time to reach the Application_Start event?
Tom Gullen
  • 61,249
  • 84
  • 283
  • 456

1 Answers1

1

What you are seeing is IIS starting up the application pool and it is normal for this to take awhile, especially if the site is large. The startup time is primarily limited by the hardware- as you are seeing one of the CPU cores reaching 100% that is your bottleneck.

As you have two web servers the best way to deal with this would be to deploy to one server and then wait for it to come back online before deploying the second. Sending a warm up request after deployment will ensure that IIS starts up as quickly as possible.

PerfectlyPanda
  • 3,271
  • 1
  • 6
  • 17
  • Thanks for this, is it possible to spread the build load across multiple requests instead of all-in on the initial request? – Tom Gullen Aug 27 '19 at 13:24
  • It's not that the first request takes the load of the startup, it's that the first request triggers the startup process. I work mainly with App Services where this is the only option. I did a bit more research and it looks like there is a configuration method you can set in IIS for this since you are on a VM: https://www.red-gate.com/simple-talk/blogs/speeding-up-your-application-with-the-iis-auto-start-feature/ It's going to do the same thing as sending a request right after deployment, namely get IIS to run it's startup process immediately. – PerfectlyPanda Aug 27 '19 at 15:01