In one of my previous blog posts, Identifying Worker Process (w3wp.exe) – IIS 6.0 and IIS 7.0 for Debugging ASP.NET Application - I have explained about how we can identify the list of currently running worker process using command prompt while we need to attach process from Visual Studio. But do you know for IIS 7.0 and IIS 7.5 we can get the worker process (w3wp.exe) details like Application Pool name, Process ID, CPU Usages from IIS Manager itself. Even you can get details of each worker process for a “Web Garden” scenarios. So when you need to attach some process for debugging from Visual Studio, instead of going to command prompt, you can easily identify the worker process Id from IIS itself.
Get Worker Processes ( w3wp.exe) List
To get list of running worker process, open IIS Manager (Run > Inetmgr), select root level from left site navigation tree and from “Features View Panel”, select “Worker Processes”
Click on the “Worker Processes” to get details of all worker process which are currently running as shown below:
So from the above list of worker processes, you can get the details of Application Pool Name, Process ID, state of worker processes along with CPU uses and memory uses.
Attach Worker Processes (w3wp.exe) For Debugging
From Visual Studio Attach Process window, you will find the same list of worker process with the same Process ID. So based on your application Pool name, you can attach the process and start the debugging.
To know more about attach process while debugging your application is running on IIS, please read one of my complete articles - Debug Your ASP.NET Application that Hosted on IIS : Process Attach and Identify which process to attach (Note: This article was targeted to debugging with IIS 6.0.)
What Else Can We Have from Worker Processes Lists in IIS 7 Manager?
We have already identified the worker process and Application Pool name which is more than enough for us to attach a process from Visual Studio. Now what else can we get out of this list? Yes, we can have enough information regarding worker process like:
- Worker Process Current State
- CPU Uses by the worker process
- Memory uses by worker process
- Current Request Handling by Worker Process
What About the Current Worker Process (w3wp.exe) State?
You can get the current status of worker process from status column. Worker processes having 3 statuses as listed below:
Running
Stopping
Starting
You must be wondering why there is no “Stopped
” Status for Worker Process in IIS? I will explorer it in a different blog post. Yeah, that will be very interesting! Very soon!
Similar like State, you can also monitor CPU % Uses and Memory Uses from the IIS Itself.
What About the Current Request at Worker Process?
Well, you can view the current request details for a particular worker process from IIS Manager itself. So, when your worker process is on running mode, if you want to check what things are going on backend, just double click on the particular worker process.
From the request details, you can get web site id, URL, HTTP Verbs, client ID and State along with Module Name. I liked the State and Module name column very much. These two columns will let you know where is your current request and which HTTP Module is taking care of that Request.
To know more about how fundamentals How IIS process ASP.NET Request, you can read one of my articles How IIS Process ASP.NET Request.
You can also read “Securely Implement Request Processing, Filtering, and Content Redirection with HTTP Pipelines in ASP.NET” to know more advance topics.
To know more about Worker Process Request, read View Currently Executing Requests in a Worker Process (IIS 7).
View Details of Each Worker Process When You Are Using Web Garden
Before start web garden mode, if you want to know more about Web garden or just wanted to recap, please read one of my previous articles, What is the difference between Web Farm and Web Garden?
If you have configured your site as Web Garden, you can also get the list of all the worker processes in the worker processes list with the different worker Process ID, but all worker processes should have a “Single Application Pool“.
So, from the above diagrams, you can see, “WCFSite
” has configured as Web Garden mode with Two Worker Processes and from the Worker Processes list, you can view both the worker processes with different Worker Process Id and both of them are listed under the same Application Pool.
Note: You will able to see only the worker processes that are in running state .
Summary
In this blog post, I have explained how you can use the power of IIS Manager to get the list of worker process with their application pool id, name, Running State along with CPU and Memory Uses along with viewing the worker process request. I have also explained about how to get details of each worker process in web garden scenarios. I will publish another blog post Worker Process State very soon.
Hope this will help!
Thanks!
AJ