Groups | Blog | Home
all groups > dotnet performance > march 2004 >

dotnet performance : webGarden setting for multi-processor machine


Vishal Gupta
3/18/2004 12:05:16 PM
Hi,

We are running our application on a dual-processor machine. Now, it seems,
by definition, a multi-processor machine is a Web Garden. I guess this would
imply that the WebGarden attribute of processModel in Machine.config, needs
to be set to "true"? Here's my comements/questions pertaining to the two
WebGarden scenarios:

a. WebGarden="false"
1. This would mean that the aspnet worker process is utilizing only one CPU?
2. The %Processor Time counter would give a more optimistic read of the
situation than is the case, because it will average out the time over 2
processors when only one is being utilized?

b. WebGarden="true"
1. This implies i have to use out-of-process technique for doing session
state management, like the asp.net state service which i have heard is about
15% slower.

In summary, using a dual-processor machine is of benefit to asp.net only if
WebGarden is set to "true" and an out-of-process technique for session
management is being used?

Any clarifications would be appreciated.

Thanks.


Alvin Bruney [MVP]
3/18/2004 11:10:01 PM
[quoted text, click to view]

No. This definition is the cause of your confusion. A web garden is a
process model responsible for 'distributing the work to several
processes, one per CPU, each with processor affinity set to its CPU'. This
means in a nutshell that each Aspnet worker process will run on its
dedicated cpu something called cpu affinity. The documentation for framework
1.0 is wrong in this regard so don't read it.

In IIS6, the model changes fundamental which only adds to the confusion, but
the underlying fact remains: In a web garden, the IIS worker process will
run on one particular cpu. This is really all there is to it. You may take
from this answer that there can be as many worker processes as there are cpu
units available, but no more since a worker process sharing a cpu opens the
door to cpu contention and deadlock. When web gardening is turned off, there
is only one worker process irrespective of the number of cpu units
available. This is the default behavior. There is more confusion here with
IIS6 because IIS6 can have many aspnet worker processes, one for each
application pool, even when web gardening is disabled. In fact, this is the
default behavior. How? the short answer is that the aspnet worker process is
simply a copy of the iis worker process.

I guess this would
[quoted text, click to view]

You have the shoe on backward. Since a multi cpu system by default will use
the pool of cpu's as it sees fit, to force one process to always execute on
one cpu (a web garden with processor affinity), you have to specifically
turn it on. Web gardening is off by default. Think of it this way, multi
processor systems existed long before webgardening so web gardening is not
the default behavior. Applications knew how to take advantage of multi
processor systems long ago.

[quoted text, click to view]
CPU?
The normal behavior of an OS is for it to utilize the cpu resource pool how
it sees fit by scheduling jobs on cpu's which have less work load to not
overwork one cpu while leading to cpu starvation in others. For this very
reason, the default behavior of a disabled webgarden is correct. The OS
should be allowed to scheduled jobs based on resources. A web garden removes
this qualification. An application running in default process mode, ie with
web gardening turned off, utilizes every cpu in the pool optimistically.

[quoted text, click to view]
No because of 1.

[quoted text, click to view]

It only implies this because the processes are running independently on
their own dedicated cpu. There can be no cpu sharing, likewise, data sharing
is restricted since these applications are running in their own little
worlds. Consider it like the processes are running inside their own
containers isolated from each other. If you need to share information among
the cpu, the processes must be able to talk to a common external thing(for
lack of a better word). Which is why you need a stateserver.

like the asp.net state service which i have heard is about
[quoted text, click to view]
ohhhhhhhhh, more like 10 to 25 percent, closer to 10 (Dino Esposito). My
independent measurements were undiscernable under light loads (< 10 users).

[quoted text, click to view]

I'd leave that up to you to correct this now that you understand what is
going on.

I've not come across a situation to use web gardening yet. But then again, i
havent been doing this for a very long time. A mutli-processor system
running without affinity has always been able to handle the load thrown at
it where I come from. Feel free to yell at me if you don't agree with
anything in there.

--
Regards,
Alvin Bruney [ASP.NET MVP]
Got tidbits? Get it here...
http://tinyurl.com/3he3b
[quoted text, click to view]


Vishal Gupta
3/22/2004 12:01:50 PM
Thanks Alvin for your explanation which was laid out very well. Exactly the
kind of clarification i was looking for.

[quoted text, click to view]

AddThis Social Bookmark Button