Advanced troubleshooting for Sitecore XP on Azure Web Apps

  • Description

    This article reviews tools and methods to collect information to use for troubleshooting a Sitecore XP application on Azure Web Apps.

    The following sections describe ways to gather relevant data for typical performance issues, such as:

    • High CPU usage.
    • Memory leaks.
    • Long response time and other types of slowness.
  • KUDU Toolset

    Microsoft Azure Web Apps (App Service) comes with the KUDU toolset enabling extended low-level diagnostics access for troubleshooting web applications.

    To run KUDU for your Sitecore XP application deployed to Azure Web Apps, use the following URL:
    https://<name-of-AzureWebApp>.scm.azurewebsites.net/

    Note: You must be logged in to the Azure Portal and have access to a particular Resource Group as a Contributor.

  • Collecting a memory dump using Procdump utility

    Azure App Service instances include the Sysinternals suite in the default image. They can be located at this path via the KUDU console: D:\devtools\sysinternals.

    It is also possible to download the ProcDump tool from here, upload it to a specific location such as D:\home\Dumps and use it.

    To collect a memory dump:

    1. Open KUDU and go to the Process Explorer.
    2. Note the PID (Process ID) of the w3wp.exe process corresponding to the application.

    3. Go to Debug Console -> CMD.
    4. In the command window, navigate to the dumps folder.
    5. Execute the following command to generate a full memory dump of the process:
      procdump.exe -accepteula -ma [PID of the process]
      -ma — write a dump file with whole process memory.
      -accepteula — automatically accept the Sysinternals license agreement.

    Note: When the manual memory dump collection is not appropriate, the Procdump utility provides the ability to specify different conditions for when to automatically collect a memory dump. For more information on this topic, please refer to the following article: How to collect memory dumps using ProcDump.

  • Collecting a memory dump Using Process Explorer (On-Demand)

    To collect a memory dump:

    1. Open KUDU and go to the Process Explorer.
    2. For the w3wp.exe process (not SCM), right-click to access the context menu.
    3. In the context menu, click Download Memory Dump -> Full Dump:

      A *.dmp file is downloaded. You can analyze it using a common tool, such as WinDbg.

    Note: To ensure that the memory dump is analyzed properly, you must have the SOS.dll file from the target OS.

    To get the SOS.dll file:

    1. Open KUDU and go to Debug console -> CMD.
    2. Navigate to the system drive using the button at the top.
    3. Locate the SOS.dll file in an appropriate .NET Framework folder (for example, C:\Windows\Microsoft.NET\Framework64\v4.0.30319).
    4. Download the SOS.dll file.
  • Collecting a memory dump using Diagnostics as a Service (DaaS)

    To collect a memory dump via the Azure portal:

    1. Login to the Azure portal (https://portal.azure.com).
    2. Select the Azure Web App that you need to troubleshoot.
    3. Click Diagnose and solve problems and then click Diagnostics as a Service:

    4. In the new blade, set the following fields:
      • Application Type – set the value to ASP.NET.
      • Diagnosers – select the Memory Dump check box. If you want Event Viewer Logs and Http Logs, you can select these check boxes too.
      • Instances – if the App Service Plan is configured to use more than one instance, you can configure this field to collect the logs on either all instances or specific instances.

    5. To collect the logs, click Run . The blade indicates the status of the operation and runs analysis on the collected data. The data is saved under the D:\home\data\DaaS\Logs folder.

    To collect a memory dump via KUDU:

    1. Open KUDU and append /daas to the path: http://<yoursitename>.scm.azurewebsites.net/daas.
    2. In the DaaS portal, to initiate logs collection, click Diagnose Now :

    3. To select the logs that will be collected and specify whether you want to run an analysis on them, click Schedule Analysis .
  • collecting a Performance Profile

    To collect a performance profile:

    1. Open KUDU and go to the Process explorer section.
    2. For the w3wp.exe process (not SCM), click Start Profiling.
    3. Request your web application home page and, to ensure that profiling is running, click Refresh on the KUDU page.
    4. Reproduce the performance issue in your web application.
    5. Go back to the Process explorer section in KUDU.
    6. Click Stop Profiling.

    After the process is finished, a profile_*_w3wp_*.diagsession file is downloaded to your PC.

    To further analyze the downloaded file, open it in Microsoft Visual Studio:

Applies to:

CMS 8.2 Update-1+

January 03, 2017
June 15, 2017

Keywords: 

  • Azure
  • ,
  • CMS
  • ,
  • Performance