App Service High Response Time

Onur 115 Reputation points
2024-01-03T17:43:33.46+00:00

When App Service is restarted or is not used for a few minutes, It response too late. How can I prevent this?

When I diagnose linux slow :

User's image

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,965 questions
{count} votes

Accepted answer
  1. SnehaAgrawal-MSFT 22,706 Reputation points Moderator
    2024-02-02T07:33:59.65+00:00

    @Onur
    Update-

    Issue details- A late response time issue was reported with their app service. They mentioned that after deleting the app service and switching to a container app, the problem persisted. The first request took 3 seconds, while the second request took 160ms. It was suspected that the slow response time was related to the initial call request to Azure storage also could be related to the table storage and recommended using different database instead.

    Resolution- As this is normal behavior for Table Storage, Its recommend using a Database (such as Azure Database for MySQL, Azure DB for Postgres, Azure DB for SQL, etc) vs Azure Table Storage if quick response is required.

    Please let us know if further query or issue remains.

    Please accept as "Yes" if the answer provided is useful, so that you can help others in the community looking for remediation for similar issues.

    1 person found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Pinaki Ghatak 5,600 Reputation points Microsoft Employee Volunteer Moderator
    2024-01-03T19:14:49.0666667+00:00

    Hello Onur

    If your Azure App Service is taking too long to respond after a restart or a period of inactivity, there are several things you can do to improve its performance:

    1. Enable Always On: This feature keeps your app loaded and responsive even when it’s not receiving requests. You can enable it by going to your app service’s Configuration page and setting the Always On option to On.
    2. Use Application Initialization: This module preloads your app before it receives any requests, which can help reduce the time it takes to respond to the first request after a restart or a period of inactivity. You can enable it by following the instructions provided in the official documentation .
    3. Optimize your code: You can use profiling tools like Application Insights to identify performance bottlenecks in your code and optimize it for better performance .
    4. Scale up or out: If your app is still slow after trying the above steps, you can try scaling up or out your app service plan. Scaling up increases the resources available to your app, while scaling out adds more instances of your app to handle incoming requests. You can learn more about scaling in the official documentation

    If the above points are already checked then check that too many things are not loaded on startup. So code optimization can help.

    I hope this helps you.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.