0

I have deployed a .Net Core API to Azure as an App Service.
I have set the Always on feature to true.
When I log the requests, I see that Azure Always on requests are coming every 5 minutes.

always on logs

My usage with API is HTTPS but Always on requests are sending with HTTP. I don't know if this is the case

azure vs usage logs

For the first request, it is sometimes 10 seconds, but after the first request, it is around 100ms.

What is missing here?

I have logged the durations: durations

4
  • 1
    Please add some (relevant) code to enable us to help you. Without any code, this is going to be a tough nut to crack. Refer to How to Ask and provide a minimal reproducible example. Commented Sep 15, 2021 at 10:09
  • Which part of code do you want to see? I don't know which piece of code to share. Commented Sep 15, 2021 at 10:23
  • It looks like it's all in the SubscriptionController. Might be the query you're executing is simply taking too much time? Again, please provide us with (relevant) code, like the Index action or the SubscriptionInfo action on the SubscriptionController. Commented Sep 17, 2021 at 13:01
  • These are the regular durations of endpoints. The problem occurs rarely after some time period at the first request. Do you still think it is code related? imgur.com/a/hDf7r32 Commented Sep 20, 2021 at 7:54

1 Answer 1

1

There are quite a few reasons why this might be the case:

  1. You're connecting to resources that take time connecting to the first time
  2. Some information is being cached and needs to be read the first time
  3. There is initialization code present
  4. Lazy instantiation of (static/singleton) instances
  5. ... other ...

Add some logging to your application, maybe enable Application Insights if you haven't done so already and go try to find the culprit.

Sign up to request clarification or add additional context in comments.

2 Comments

I have added durations logs, does it mean anything?
I dont think connectting a resource will take time. And there is no cache. There is no initialization process. There is no lazy instantiations. So it must be something else.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.