Home > OS >  .NET core app hosted on azure first request very slow
.NET core app hosted on azure first request very slow

Time:02-01

I have an issue with my .NET core app hosted on Azure. Everything works fine in production but the first request after an inactivity period is very very slow (sometimes up to 10-15 seconds).

I don't get where the issue comes from because it didn't happened previously when I was hosting the app on DigitalOcean.

I added below some screenshots of the app on Azure. Could you please let me know if anyone of you already met a similar issue?

Thanks a lot!

App Service Details App Service Details

Linux Plan Details Linux Plan Details

Slow Request Example Slow Request Example

App Service Configuration App Service Configuration

CodePudding user response:

If you deploy with deployment slots, you can leverage warming-up. You can even customize the operation: see documentation

CodePudding user response:

This is expected behaviour and happens on local IIS deployments as well.

When you deploy a new version of your site to azure and subsequently make a request to it, it will need to load the resources it depends on into scope which will then be available for the lifetime of that service.

In Production, it might be wise to call the healthcheck pages (which you should already have!) which will alleviate this delay in the case of the resources going out of scope.

  •  Tags:  
  • Related