Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Note
Some of the following guidelines might only work on Windows App Service or Linux App Service. For example, Linux App Service runs in 64-bit mode by default.
Summary
This article answers frequently asked questions (FAQ) about application performance issues for the web apps feature of Azure App Service.
Where can I learn more about quotas and limits for various App Service plans?
For information about quotas and limits, see App Service limits.
My App Service plan displays CPU or memory usage even when all web apps are stopped
App Service requires continuous system processes that handle several platform operations and features, such as security updates, availability of the SCM (Kudu) console, application monitoring, authentication, and many other web app features.
System processes run on App Service plans even if there are no web apps running or if the App Service plan contains no web apps.
The platform processes consume a minimum amount of resources (such as CPU, memory, and disk space), and you should account for these resources during the capacity planning, monitoring, and auto-scaling trigger configuration of an App Service plan.
My app performance is slow
Multiple factors might contribute to slow app performance. For detailed troubleshooting steps, see Troubleshoot slow web app performance.
Tip
- Enable the Always On setting under Configuration > General settings to keep your app warm and avoid cold starts. This setting helps reduce delay after idle time, especially in Basic and higher plans.
- Configure a Health check path to monitor app health and automatically replace unresponsive instances. This configuration helps maintain availability and performance. For more information, see Monitor App Service instances by using Health check.
How do I troubleshoot high CPU consumption?
In some high CPU consumption scenarios, your app might truly require more computing resources. In that case, consider scaling to a higher service tier so the application gets all the resources it needs. Other times, high CPU consumption might be caused by a bad loop or by a coding practice. Getting insight into what's triggering increased CPU consumption is a two-part process. First, create a process dump, and then analyze the process dump. For more information, see Capture and analyze a dump file for high CPU consumption for Web Apps.
How do I troubleshoot high memory consumption?
In some high memory consumption scenarios, your app might truly require more computing resources. In that case, consider scaling to a higher service tier so the application gets all the resources it needs. Other times, a bug in the code might cause a memory leak. A coding practice might also increase memory consumption. Getting insight into what's triggering high memory consumption is a two-part process. First, create a process dump, and then analyze the process dump. Crash Diagnoser from the Azure Site Extension Gallery can efficiently perform both these steps. For more information, see Capture and analyze a dump file for intermittent high memory for Web Apps.
How do I automate App Service web apps by using PowerShell?
You can use PowerShell cmdlets to manage and maintain App Service web apps. See Automate web apps hosted in Azure App Service by using PowerShell for more information on how to use Azure Resource Manager-based PowerShell cmdlets to automate common tasks.
Note
For current automation scripts, use the latest Az.Websites module. The older AzureRM module is deprecated.
I need to gather information to troubleshoot my web app
View a web app's event logs
To view a web app's event logs, follow these steps:
- Sign in to your Kudu website (
https://*yourwebsitename*.scm.azurewebsites.net). - In the menu, select Debug Console > CMD.
- Select the LogFiles folder.
- To view event logs, select the pencil icon next to eventlog.xml.
- To download the logs, run the PowerShell cmdlet
Save-AzureWebSiteLog -Name webappname.
Capture a user-mode memory dump of a web app
To capture a user-mode memory dump of a web app, follow these steps:
- Sign in to your Kudu website (
https://*yourwebsitename*.scm.azurewebsites.net). - Select the Process Explorer menu.
- Right-click the w3wp.exe process or your WebJob process.
- Select Download Memory Dump > Full Dump.
View process-level info for a web app
You have two options for viewing process-level information for your web app:
In the Azure portal:
- Open the Process Explorer for the web app.
- To see the details, select the w3wp.exe process.
In the Kudu console:
- Sign in to your Kudu website (
https://*yourwebsitename*.scm.azurewebsites.net). - Select the Process Explorer menu.
- For the w3wp.exe process, select Properties.
- Sign in to your Kudu website (
I can't find my log files in the folder structure of my web app when using the local cache feature of App Service
If you use the local cache feature of App Service, it affects the folder structure of the LogFiles and Data folders for your App Service instance. When local cache is used, the system creates subfolders in the storage LogFiles and Data folders. The subfolders use the naming pattern "unique identifier" plus time stamp. Each subfolder corresponds to a virtual machine (VM) instance in which the web app is running or has run.
To determine whether you're using local cache, check your App Service Application settings tab. If the system uses local cache, the app setting WEBSITE_LOCAL_CACHE_OPTION is set to Always.
To turn on failed request tracing
To turn on failed request tracing, follow these steps:
In the Azure portal, go to your web app.
Select All Settings > Diagnostics Logs.
For Failed Request Tracing, select On.
Select Save.
On the web app blade, select Tools.
Select Visual Studio Online.
If the setting isn't On, select On.
Select Go.
Select Web.config.
In system.webServer, add the following configuration (to capture a specific URL):
<system.webServer> <tracing> <traceFailedRequests> <remove path="*api*" /> <add path="*api*"> <traceAreas> <add provider="ASP" verbosity="Verbose" /> <add provider="ASPNET" areas="Infrastructure,Module,Page,AppServices" verbosity="Verbose" /> <add provider="ISAPI Extension" verbosity="Verbose" /> <add provider="WWW Server" areas="Authentication,Security,Filter,StaticFile,CGI,Compression, Cache,RequestNotifications,Module,FastCGI" verbosity="Verbose" /> </traceAreas> <failureDefinitions statusCodes="200-999" /> </add> </traceFailedRequests> </tracing>To troubleshoot slow-performance issues, add this configuration (if the capturing request is taking more than 30 seconds):
<system.webServer> <tracing> <traceFailedRequests> <remove path="*" /> <add path="*"> <traceAreas> <add provider="ASP" verbosity="Verbose" /> <add provider="ASPNET" areas="Infrastructure,Module,Page,AppServices" verbosity="Verbose" /> <add provider="ISAPI Extension" verbosity="Verbose" /> <add provider="WWW Server" areas="Authentication,Security,Filter,StaticFile,CGI,Compression, Cache,RequestNotifications,Module,FastCGI" verbosity="Verbose" /> </traceAreas> <failureDefinitions timeTaken="00:00:30" statusCodes="200-999" /> </add> </traceFailedRequests> </tracing>To download the failed request traces, in the Azure portal, go to your website.
Select Tools > Kudu > Go.
In the menu, select Debug Console > CMD.
Select the LogFiles folder, and then select the folder with a name that starts with W3SVC.
To see the XML file, select the pencil icon.
Additional recommendations for performance and resilience
Use Application Insights and Azure Monitor for full-stack observability of your App Service app, including telemetry, dependency tracing, and live metrics.
If you're deploying in regions that support availability zones, consider enabling zone redundancy to enhance resilience during regional outages. For more information, see Reliability in Azure App Service.
App Service undergoes routine maintenance to ensure platform reliability. For more control over update behavior, especially in App Service Environment v3, configure upgrade preference. For more information, see Routine (planned) maintenance for Azure App Service.