32

Are there any downsides to giving Application Pools multiple Worker Processes in IIS? They seem really easy to enable and (almost) everything I’ve read seems to suggest they’re good... so why doesn’t IIS give each App Pool 10+ Worker Processes? There must be some detrimental effects, right?

Nai
  • 743
  • 1
  • 6
  • 24

1 Answers1

39

You're right to be suspicious. Web Gardens having no downside is a massive myth, they can cause you no end of problems, but many people still don't even know when they should be used.

According to Chris Adams (from the IIS team) there is only a single reason you would want to use a Web Garden: To give applications, that are not CPU-bound but execute long running requests, the ability to scale and not use up all threads available in the worker process. There are lots of reasons why they can be bad, however, it is a common misconception that there's no downside.

They increase system overheads (they don't share cache), they don't share sessions (the user can lose their session if they're switched over to another process), InProc can get messed up. In short, they're actually, more often than not, a lot of trouble, and you shouldn't be using one without good reason.

Read Chris's full explanation: http://blogs.iis.net/chrisad/archive/2006/07/14/1342059.aspx

Further reading: http://weblogs.asp.net/owscott/why-you-shouldn-t-use-web-gardens-in-iis-week-24

Django Reinhardt
  • 2,256
  • 3
  • 38
  • 55
  • 5
    Well said, as is Chris' post. Web gardens are almost never needed. A single process per server is all that is required in 99.5% of the time. I've had opportunities to test web gardens on high load servers that weren't performing well and we never kept them enabled in the end. We always found better solutions. It's only for low resource-long running tasks that they help. Using them has a larger memory footprint and session continuity issues. While that can be worked around, it's rarely needed. – Scott Forsyth Nov 05 '09 at 16:17
  • It's scary how many texts never mention their downsides -- even Microsoft's own website has pages like that. – Django Reinhardt Nov 06 '09 at 12:18
  • 7
    All's well about not considering web gardens in most cases.. BUT SESSION problems? I mean only if you are set to InProc. Now you wouldn't be using InProc in production, right?! – Andrei Rînea Nov 16 '09 at 14:11
  • @AndreiRinea Amazing how few people know there are alternatives to InProc.. – Gats Mar 30 '13 at 09:53
  • 2
    As much as this is certainly the best answer, right now the only information I can find on when to use a web garden is the exact quote in this answer (i.e., "...applications, that are not CPU-bound..."). The problem for me is that I don't know what some of those terms mean. Perhaps that means I shouldn't be playing with it, but I'm a sysadmin, not a developer, and sometimes developers don't know these things either. So really a more complete explanation of what that quote *means* would be nice. – Todd Wilcox Dec 22 '16 at 18:40
  • This does dive into more detail in a way that helps me understand better, although this is also out of date: https://msdn.microsoft.com/en-us/library/aa720391(v=vs.71).aspx – Todd Wilcox Dec 22 '16 at 18:43
  • Todd Wilcox CPU-bound could be called cpu-intensive. Other spectrum is "resource intensive". So, lot of calculations using substantial cpu power or dealing with resources (files, network etc) – Mariusz Mar 23 '18 at 16:40