How to collect diagnostics information for troubleshooting slow request processing issues in Azure App Service


Description

This article describes how to collect diagnostics information for troubleshooting slow request processing issues in Azure App Service using the Auto-Heal feature by setting up an Auto-Heal rule.

Solution

To configure an Auto-Heal rule, perform the following steps:

  1. Select the affected Azure Web App.
  2. Select Diagnose and solve problems.




    Then choose Diagnostic Tools.



    Click Auto-Heal.




  3. Set Custom Auto-Heal Rules Enabled to On.
  4. In Define Conditions, select Request Duration.
  5. Click Add Slow Request rule.
  6. Populate the four fields that appear on the screen, for example:

     
  7. Click Ok.
  8. In Configure Actions, select Custom Action.
  9. Choose CLR Profiler With Thread Stacks.




  10. Make sure to choose the CollectLogs option.
    Note that selecting CollectKillAnalyze results in recycling the application, so avoid this option.
  11. Save the configured action.



  12. Proceed to Review and Save your Settings.
    When you click Save the rule is enabled. 
    Attempt to recreate the issue to trigger the rule. Wait for the issue to occur and performance profiles to be generated.

    Note: Leaving the Auto-Heal rule enabled for prolonged periods of time without restarting the process might lead to further degradation of application performance.
    If the collection of performance profiles is not triggered then you might need to adjust the Slow Request Rule parameters (step 6).




  13. When the issue occurs, download the automatically generated performance profile files.

    Try to investigate the cause of the slowness using the Microsoft PerfView tool available at:
    https://github.com/microsoft/perfview/releases.

    Create a Sitecore support case to get assistance with the investigation. Make sure to share not only the collected performance profiles but also a detailed description of the issue and basic information about your Sitecore installation.