Friday, March 1, 2013
Mapping IIS worker processes to pools
Once in a while you have to diagnose memory or performance issues with .NET applications. The first indication comes from the Windows task manager which may indicate a process hogging the CPU/memory or users may complain of excessive slowness. In my particular case, I recently examined an IIS6 worker process which was spinning at 20% and using 1GB of memory on a 32 bit Windows 2003 Server. Combine with user complaints that the system was extremely slow and unresponsive, it was something to look into. The investigation is still ongoing, but I am documenting the steps taken so far.
Step #1: Find out which application or applications are causing the problem. Using the process ID from the task manager, you can use one of the following methods depending on whether this is IIS6 or IIS7
- On II7 the IIS Manager gives an option to locate running worker processes, the pools they belong to and the requests they are currently processing right from the GUI.
- On II6, this can get a little tricky. A little VB Script can be of help: IISApp.vbs. Since it is typically found in the system folders, you can pretty much run it directly from the command tool. Note that this script won't be found on IIS7 installs.
Step #2: The next step typically is to start tracking performance counters and see which ones may indicate problems. From the command prompt, type "perfmon". Using perfmon, you can turn on different performance counters. The slowness can be due to a variety of reasons. There could be a queue which is getting very long - a processor or network queue for example or system is doing too many context switches or there are too many interrupts or .NET garbage collection could be going on. The important point is to pick a place to start and find patterns. For example, I noticed that the processor queue length was relatively high and the context switches were very high in the system. The next step, it seemed to me was to try and isolate the process threads which were switching in and out and what was causing them to block so the OS would switch the thread out.
Perfmon shows multiple instances of the same process with suffixes like "#1", '#2' etc. This is not very helpful and brings us to Step #3 meanwhile in the digging process:
Step #3 The following article from Microsoft describes how to fix perfmon to print process IDs instead.
http://support.microsoft.com/kb/281884
No comments:
About Tukeys
Tukeys provides consulting and software services to companies in healthcare and communications that are dealing with technical or scaling challenges. Please reach out to me on LinkedIn.
An interesting quote from John Tukey, who was an American mathematician (1915-2000) -
An approximate answer to the right problem is worth a good deal more than an exact answer to an approximate problem.
Today maths and statistics form the basis of how software is developed and used around us.
About Me
I have over 20 years of experience in healthcare, communications and AI.
I have a passion for defining innovative applications, creating product/technology strategy and solving challenging problems. My product mindset is helpful to any company to find patterns, reduce costs, and gain efficiencies.
I was the VP of Engineering at Vibrent Health, where I led the web, mobile, API and data products that supported one of the largest NIH programs - All of Us Research Program. Our system enrolled almost a million users and collected data from EHRs, surveys and wearables. Before that, I worked at hCentive, a pioneer in health exchanges.
As the CTO of 3CLogic, I helped create the first PC and web-only contact center solution that implemented PBX and CRM functionality as an affordable SaaS solution. As the Chief Architect of NexTone, I was instrumental in the development of SIP and SIP based products. SIP and associated protocols form the basis of modern WebRTC APIs.
If you are a growth company or invest in growing companies that are facing technical or scaling challenges, I can be a tremendous help. Contact me on LinkedIn.
Featured Post
Random Forest Analysis of U.S. National Epidemiological Survey on Alcohol and Related Conditions (NESARC) data
In 2001/2002, the National Institute on Alcohol Abuse and Alcoholism (NIAAA) conducted the National Epidemiologic Survey on Alcohol and Re...
Blog Archive
- 2014
- 2013
- June
- May
- April
- March