Could anyone explain/give a link to explanation on how is load balancing is performed within web gardens (IIS 6)?
Here is a problem I'm facing:
I have 6 WPs in my web garden (app pool)
This app pool serves one and only application (WCF service)
Some of the requests take much time to execute.
As a result, I have 5 WPs that are OK and 1 that is busy (it serves a long running request to DB) However, 1/6 of requests is queued to the busy WPs queue (IIS seems to use simple round robin).
So, things I want to figure out:
Am I correct with my suggestion that IIS uses simple round robin to distribute requests?
Does IIS take into account WPs queue length, or not?
Do I have any chance to interfere with this algorithm?
Is IIS 7 different to IIS 6 as far as web gardens load balancing is concerned?
Does it make any difference which application type is used? I mean WCF and usual web services. In many cases, settings from machine.config and web.config that are applied to web services do not affect WCF services. But for now I'm interested in load balancing
only.
Personally I wouldn't touch web gardens however you a seem to be in a situation with long queue lengths so it *could* be suitable. Although I still doubt the usefulness/benefits of it I haven't seen any need for a web garden (in fact, it is often degrades
performance) in any of my years of doing this.
I don't understand what you mean I have
"As a result, I have 5 WPs that are OK and 1 that is busy (it serves a long running request to DB)"
Are you saying that all the complex requests are processed by 1 wp? Are you see significant wait times? Do you have processor affinity for the CPU set for the gardens? Obviously the CPU still has to do the work of the wp's irrespective of how many there
are.
AFAIK it is all round round for webgardens and you cannot look at the queue length.
In a load balanced environment I would first question the need for garden. Try them with and time both. You will need sticky/affinity so the user will go to the correct box and then server/SQL sessiosn information so you can keep track of the user.
"As a result, I have 5 WPs that are OK and 1 that is busy (it serves a long running request to DB)"
Are you saying that all the complex requests are processed by 1 wp? Are you see significant wait times? Obviously the CPU still has to do the work of the wp's irrespect of how many there are.
Sorry if I was not clear. Let me explain it one more time:
Say, I have 3 worker processes, A, B and C.
I have a number of almost equal requests to my service. They are handled by IIS and are distributed between worker processes automatically. However, sometimes I get a complex request, that takes lots of time to be executed.
Say, worker process A recieved a complex request, that will take up 10 minutes to be executed. My service is configured in singletone/singlethreaded maneer (it is all because of COM component it is using - this is why I do not use multithreading instead
of web gardens), so A is completely busy. It can not process any requests simultaneously.
The rest worker processes (B and C) are not busy at the same time. However, further requests are distributed by IIS equally. If 30 requests were recieved, 10 will go to A's queue, 10 - to B's queue and 10 to C's. However, A is not available to process requests,
and its queue is growing.
As you can see, average queue size for B and C requests will be quite small. However, A's queue size will grow continuously.
So my questions are (with respect to renewed explanation of my problem):
Does IIS 6 monitors worker process queue size while distributing requests among worker processes? Obviously, I expect it does, since it's quite a simple case. However, I do not feel it does (accordingly to my expirience). So, I want to know whether it is
capable to more sophisticated load balancing than round robin. It might be connected to WCF nature of my application - so I need to know where to look for an answer. So, If you can confirm it works for usual web apps and services - it will be quite interesting
point for me.
If IIS 6 is not capable of such things, can I implement a kind of custom balancer for web gardens (I'm not going to rewrite it's native acceptor - I'm looking for something that could be implemented in 3-5 days)?
If IIS 6 does not provide such features, what about IIS 7?
To answer Dmitry's question: web gardens don't support any customization of the load balancing algorithm for neither IIS6 nor IIS7. There is a hardcoded client connection affinity to a worker process instance. So for a given client TCP connection all the
HTTP requests will be handled by the same instance of the worker process.
Web gardens will not help you much in your situation.
I was in doubt anyone is going to answer my question ever :) So, its not just a round robin - tcp connections are taken into account while balancing...
Your post has pretty explained problems I've run into.
dmitry.katol...
3 Posts
Web garden load balancing
May 07, 2009 11:29 AM|LINK
Hi, guys!
Could anyone explain/give a link to explanation on how is load balancing is performed within web gardens (IIS 6)?
Here is a problem I'm facing:
So, things I want to figure out:
- Am I correct with my suggestion that IIS uses simple round robin to distribute requests?
- Does IIS take into account WPs queue length, or not?
- Do I have any chance to interfere with this algorithm?
- Is IIS 7 different to IIS 6 as far as web gardens load balancing is concerned?
- Does it make any difference which application type is used? I mean WCF and usual web services. In many cases, settings from machine.config and web.config that are applied to web services do not affect WCF services. But for now I'm interested in load balancing
only.
Thanks in advance!web garden wcf load balancing
Rovastar
3321 Posts
MVP
Moderator
Re: Web garden load balancing
May 07, 2009 12:37 PM|LINK
Personally I wouldn't touch web gardens however you a seem to be in a situation with long queue lengths so it *could* be suitable. Although I still doubt the usefulness/benefits of it I haven't seen any need for a web garden (in fact, it is often degrades performance) in any of my years of doing this.
I don't understand what you mean I have
"As a result, I have 5 WPs that are OK and 1 that is busy (it serves a long running request to DB)"
Are you saying that all the complex requests are processed by 1 wp? Are you see significant wait times? Do you have processor affinity for the CPU set for the gardens? Obviously the CPU still has to do the work of the wp's irrespective of how many there are.
AFAIK it is all round round for webgardens and you cannot look at the queue length.
In a load balanced environment I would first question the need for garden. Try them with and time both. You will need sticky/affinity so the user will go to the correct box and then server/SQL sessiosn information so you can keep track of the user.
dmitry.katol...
3 Posts
Re: Web garden load balancing
May 07, 2009 02:48 PM|LINK
I don't understand what you mean I have
"As a result, I have 5 WPs that are OK and 1 that is busy (it serves a long running request to DB)"
Are you saying that all the complex requests are processed by 1 wp? Are you see significant wait times? Obviously the CPU still has to do the work of the wp's irrespect of how many there are.
Sorry if I was not clear. Let me explain it one more time:
Say, I have 3 worker processes, A, B and C.
I have a number of almost equal requests to my service. They are handled by IIS and are distributed between worker processes automatically. However, sometimes I get a complex request, that takes lots of time to be executed.
Say, worker process A recieved a complex request, that will take up 10 minutes to be executed. My service is configured in singletone/singlethreaded maneer (it is all because of COM component it is using - this is why I do not use multithreading instead of web gardens), so A is completely busy. It can not process any requests simultaneously.
The rest worker processes (B and C) are not busy at the same time. However, further requests are distributed by IIS equally. If 30 requests were recieved, 10 will go to A's queue, 10 - to B's queue and 10 to C's. However, A is not available to process requests, and its queue is growing.
As you can see, average queue size for B and C requests will be quite small. However, A's queue size will grow continuously.
So my questions are (with respect to renewed explanation of my problem):
Advice Pro
4 Posts
Re: Web garden load balancing
Jun 19, 2009 11:11 PM|LINK
What is a web garden?
Paul Lynch
1589 Posts
Re: Web garden load balancing
Jun 20, 2009 05:04 AM|LINK
MCSE
JaroDunajsky
194 Posts
Microsoft
Re: Web garden load balancing
Jun 22, 2009 12:47 AM|LINK
To answer Dmitry's question: web gardens don't support any customization of the load balancing algorithm for neither IIS6 nor IIS7. There is a hardcoded client connection affinity to a worker process instance. So for a given client TCP connection all the HTTP requests will be handled by the same instance of the worker process.
Web gardens will not help you much in your situation.
dmitry.katol...
3 Posts
Re: Web garden load balancing
Jun 22, 2009 06:31 AM|LINK
Great thanks, Jaroslav!
I was in doubt anyone is going to answer my question ever :) So, its not just a round robin - tcp connections are taken into account while balancing...
Your post has pretty explained problems I've run into.