1
  • I have a simple web api using .Net framework 4.5 and Entity Framework.

  • The problem is the first call to the backend (WebAPI) is really slow.

  • I had found a workaround here use Application warm up setting but in my IIS Version 10 I cannot find that setting:

enter image description here

Does anyone have another solution or idea's? Thanks a lot.

Jeremy Thompson
  • 61,933
  • 36
  • 195
  • 321
farid wahyu
  • 81
  • 1
  • 11
  • See this: https://learn.microsoft.com/en-us/iis/configuration/system.webserver/applicationinitialization/ – Amit Feb 23 '22 at 04:16
  • Cold start slowness can be caused by tons of factors, so before doing anything serious, learn a .NET profiler and use it to identify the actual bottleneck. Blind bid on possible causes only waste more time. – Lex Li Feb 23 '22 at 07:23
  • In the IIS, go to `AppPool-> Advanced Settings`. Set `StartMode to AlwaysRunning`. Increase `Idle Time-out minutes` as per your requirements. Go to `your_site-> Advanced Settings`. Set `Preload Enabled to True`. If the issue persists, do you need to inform us whether your application gets shut down or you restart the machine and start facing the issue while calling the site the first time? – Deepak-MSFT Feb 23 '22 at 08:49

2 Answers2

0

My suggestion is used caching for same type of data used in whole application which will reduce time of execution and in your problem statement there might be issue with shutting down of server when there is inactivity of request...

theKing
  • 11
  • 3
0

you can use Lazy load for performance for next time loading you can use caching for example if you use stored procedure you can use

OFFSET @skip ROWS FETCH NEXT @PageCount ROWS ONLY
Peter Csala
  • 17,736
  • 16
  • 35
  • 75