How to identify the process ID of a running Sitecore instance


Problem

In a process of diagnostic measurements or procedures it may be necessary to identify the ID of the exact Windows process that corresponds to a specific running Sitecore instance.

All ASP.NET processes that run using IIS 6 or later have the name "w3wp.exe".

On a web server that runs only a single ASP.NET site the procedure is very straightforward and can be implemented using the Windows Task Manager and checking the value of the PID column on the tab that lists details of all running processes.

The task becomes more complicated when there are multiple web applications running on a single server.

Option 1: Using The Command Line Arguments

This is a straightforward way that does not require any special tools.

OPtion 2: Using Sitecore Log Files

When the Sitecore instance starts, it writes its corresponding process ID to the log file. Sitecore logs can be used to determine a current process ID of a running Sitecore instance.

Note: If Sitecore website has been running for a while, it may take some time to find the log file that corresponds to the latest startup.

Option 3: Using Appcmd.Exe

The AppCmd.exe tool can be used to list all the running ASP.NET worker processes. The resulting output will contain application pool names alongside the process IDs.

To use the tool, follow the instructions below:

Notes: