Summary
The blog is intended to provide guidance on how to troubleshoot any High CPU Usage / slow performance / memory leaks / hangs by a process in Internet Information Services (IIS). Also this could be used across any applications hosted in IIS but not limited to Sitecore CMS.
Details
Symptoms of High CPU Usage would include latency in web page response times or slow performing server. There are different ways and various tools and technologies to troubleshoot this issue however I will limit it to default Microsoft Debug Tool.
First step to troubleshoot this is to create a Memory Dump of the IIS Process when IIS is still processing the client requests. In a Sitecore / .Net hosted app typically this process would be w3wp process.
Microsoft's Debug Diagnostics Tool comes in very handy and can be used to capture, analyze memory dump files when IIS processes client requests.
How to Configure Debug Diagnostics Tool:
- Once the tool is downloaded open DebugDialog.Collection.exe from the configured folder ( default folder - C:\Program Files\DebugDiag) and navigate to Tools - Options and Settings - Performance Log - Enable Performance Counter Data Logging as shown below
- Next step is to create a dump file which can be done using two routes such as a configuration of a hang rule or using manual method. In this series I'll explain the automated process.
Method 1 - How to create and configure Rules:
- Navigate to the rules tab and add a new rule. For this series let us assume that it's a performance issue and select & configure the Performance option as below:
- As explained in the screenshot below this can be done based on different triggers either using the Counters Threshold limit or latency in the Response Times. Assuming we are experiencing very slow responses I will select HTTP Response Times option.
- Configure the website URL here where we are experiencing the slowness and update the timeout or ping options based on the application. Default setup looks at any host that includes with or without https and both ports. There is an option here to specify a specific folder / path / virtual directory as well.
- Prerequisite - If you choose the ETW option make sure to have tracing enabled on your server. Depending on whether it's a Windows 10 or Windows Server here are few instructions from Microsoft on how to enable it.
- Last step is to configure the dump target, location and frequency of the dump files. While creating the targets select application pool or w3wp process.
- Once the rule is activated browse the configured site / web service in any browser. IIS will start tracking and based on the configurations provided earlier dumps will be generated in the configured folder.