« Previous Next »

Thread: Web garden load balancing

Last post 06-22-2009 2:31 AM by dmitry.katolikoff. 6 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (7 items)

Sort Posts:

  • 05-07-2009, 7:29 AM

    Web garden load balancing

    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:

    • 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.
    Thanks in advance!
  • 05-07-2009, 8:37 AM In reply to

    Re: Web garden load balancing

    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.

  • 05-07-2009, 10:48 AM In reply to

    Re: Web garden load balancing

    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):

    1. 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.
    2. 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)?
    3. If IIS 6 does not provide such features, what about IIS 7?
  • 06-19-2009, 7:11 PM In reply to

    Re: Web garden load balancing

     What is a web garden?

  • 06-20-2009, 1:04 AM In reply to

    Re: Web garden load balancing

  • 06-21-2009, 8:47 PM In reply to

    Re: Web garden load balancing

    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.

    Jaroslav Dunajsky (MSFT, IIS)
  • 06-22-2009, 2:31 AM In reply to

    Re: Web garden load balancing

     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.

Page 1 of 1 (7 items)
Microsoft Communities