"Anthony Jones" wrote:
Define 'Huge'. Are you sure that it was a problem? How many CPU cores do
you have and can you add more? I'm not sure how using a Web Garden actually
resolves the problem. What is the CPU usage rate like?
Hi Anthony, thanks for your reply.
You are quite right that I should have provided more details - sorry about
the vagueness of the first post.
When running on a single worker process the Context Switches per second gets
up to 300K+. This is on a dual quad core machine so it a lot of context
switches per core.
When the application pool is configured to use 8 worker processes (one per
core) the context switches fall to less than 10K.
In both cases the CPU utilization stays around 30-50%. It seems to be pretty
clear that the context switches are the problem for us (unless I am missing
something else ;-).
I am not really sure why there would be such a big difference in context
switches because of the number of worker process (for exactly the same load)
but it is dramatic. The average response time per page goes from about 1.3s
to 12s.
Are your clients connecting via a proxy or firewall, (even if they are
internal clients I've often seen configurations which unintentionaly route
HTTP through a firewall/proxy to an internal server)?
No, the clients are connecting directly (we have done tests that go through
a firewall and the results are the same).
That said its not possible to guarantee a fixed connection. Additionally
browser will use more than one connection, the likely hood is then that the
browser will have one connection on one process and another to the other
process.
Web Gardens are not compatible with inproc session state. There is no good
mechanism in place that can affiliate a session with a process.
That is a shame (but not a huge surprise). We were hoping the knowledge base
article 822171 might be referring to some technique for keeping the
connection alive and having all the requests for a particular session routed
to the same worker process.
Load balancing and a Web Farm is more intelligent its able to affiliate a
client with a server.
We are looking into that now.
Other options would be:-
Divide the site into separate applications what each run in their own pool
This is another option we are looking at. We are seeing whether the
application can be run as several IIS applications and we may put our own
dispatcher in front of it.
Allow commonly request chunks of dynamically generated HTML that don't often
differ from one request to the next to be cached.
Unfortunately all our pages are generated dynamically so caching is not an
option but we do believe we will find an alternate solution.
Thanks again for your thoughts.
>
--
Anthony Jones - MVP ASP/ASP.NET