13

I don't understand why there are two ASP.NET w3wp processes in Task Manager when I only have one website and one application pool. Why are there two processes running? I have Googled this and looked on MSDN but cannot find an answer.

I am trying to debug a memory leak in an application. I understand the concept of threading and multiple threads living in a process, but I do not understand why there are multiple processes.

I am specifically asking what scenarios can cause more than one process to run.

hdoghmen
  • 3,175
  • 4
  • 29
  • 33
w0051977
  • 15,099
  • 32
  • 152
  • 329
  • 2
    An AppPool can have more than one worker process. Under advanced settings of the AppPool, what is "maximum number of worker processes" set to? (That's for IIS 7, there is an equivalent for IIS 6 though) – vcsjones May 02 '12 at 21:27

1 Answers1

9

Look at the Advanced Settings of your application pool for this section, and make sure the indicated value is set to 1:

IIS Maximum Worker Processes

Joel Coehoorn
  • 399,467
  • 113
  • 570
  • 794
  • ,thanks. This is set to two. Can you explain a scenario where two worker processes are needed before I mark the question as answered. I understand the concept of multi threading in a process but not multi process. – w0051977 May 02 '12 at 21:38
  • 4
    Set this value to 2 or more is called web gardening. You should not enable that unless you really understand it, http://weblogs.asp.net/owscott/archive/2011/06/13/why-you-shouldn-t-use-web-gardens-in-iis-week-24.aspx and http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/57fd3d02-9b05-4b3f-8c3a-f326ff895ab8.mspx?mfr=true – Lex Li May 03 '12 at 03:13
  • @LexLi Sigh. Both of those links are stale now. :( – Joel Coehoorn May 09 '19 at 20:18
  • There are still tons of similar posts, like https://weblogs.asp.net/owscott/why-you-shouldn-t-use-web-gardens-in-iis-week-24 – Lex Li May 09 '19 at 20:31