Azure app service performance

Venkatachalam, Rohit (Partner) 26 Reputation points
2021-09-22T11:29:43.853+00:00

We have deployed a Django App in an Azure app service. It runs on a linux container. Python version is 3.8
The app runs an analytics application and can take some time to execute. The pricing plan is P2V2. 7GB memory
Sometimes we get a gateway time out error when the process takes a longer time.

When this occurs, the app cannot further any further requests and needs to be restarted.

I checked the cpu utilization and memory percentage. The cpu is hardly running at 30% and Memory is also around same. Configuring a scale out plan is not of any use. The HTTP requests are not going to be high.
Another weird behavior I observed is. We created a staging slot to test before moving it to production slot.
The dev slot seems to be more performant than the production slot. The staging slot has 0% traffic allocated.

While I am trying to improve the algorithm performance, what can be done to improve the performance.
can I trigger the restart of the server based on some rules or logs?

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
6,908 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. SnehaAgrawal-MSFT 18,366 Reputation points
    2021-09-23T10:14:53.677+00:00

    Thanks for asking question! If App is facing slower performance this may be due to following cause:

    • network requests taking a long time
    • application code or database queries being inefficient
    • application using high memory/CPU
    • application crashing due to an exception

    Suggest you to perform these troubleshooting steps in sequential order:

    1.Observe and monitor application behavior
    2.Collect data
    3.Mitigate the issue

    As per your ask sure, you can use AutoHeal:

    Auto-Heal provides you with an easy way to take an action when your app is having an unexpected behavior. The triggers allow you to define various conditions based on request count, slow requests on which you can restart the app container. Please note that these mitigations should only be considered a temporary workaround until you find the real cause for the issue causing the unexpected behavior.

    For more information, check this link: https://learn.microsoft.com/en-us/azure/app-service/troubleshoot-performance-degradation#use-autoheal

    Also, check link: https://learn.microsoft.com/en-us/azure/app-service/troubleshoot-intermittent-outbound-connection-errors

    Let us know if issue remains or further query on this.