3 Replies Latest reply on Aug 24, 2012 8:39 AM by jfclere

    Load balancing behaviour

    nichele

      Hi,

      i would like to ask your help in order to better understand how load-balancing works using mod-cluster (indeed i think the questions are appliable to mod_jk and mod-proxy as well).

       

      In my environmnet i have 3 apache 2.2.22 instances and 3 tomcat 7.0.27 instances.

       

      In front of apache instances I use Amazon ELB (load-balancer round robin DNS based).

       

      All my tomcat instances are configured with 200 threads (using ajp connector).

       

      Now the questions :-) :

      1. am i wrong expecting the whole system able to handle 600 HTTP concurrent client requests ?

      2. What value for  maxClients i have to set in each httpd instances ? At this time i'm not sure between 200 (as each tomcat) or 600 (as total number of tomcat threads).

      3. supposing to set 600 as maxClients on every httpd instance, it means that a single httpd could exaust all the threads of a single tomcat instance. If this is true, the other 2 httpd will see that tomcat as not working ?

       

      Please helpmeee...

       

      Thanks in advance

      ste

        • 1. Re: Load balancing behaviour
          jfclere

          1) Basically with Amazon ELB you can't predict where a session is going to landing but the logic of the Apache httpd load-balancer will have to connect to the right node.

          So for one request you may need up to 3 connections to the same tomcat node. So you need to configure tomcat to handle a lot of connections.

          2) 200 in httpd and 600 in Tomcat :-(

          3) the httpd should get the same load so at some point the whole system will hang if you don't define the max correctly (depend on the webapp).

           

          You can use the NIO or APR connector in Tomcat so you can have a lo of connections and not that many threads.

          • 2. Re: Load balancing behaviour
            nichele

            Thanks Jean,

            your info (in particular number 2) is really useful. Actually i was following the suggestion coming from http://lbconfig.appspot.com/ that doesn't point out the right number of maxClients/maxThreads.

             

            Ste

            • 3. Re: Load balancing behaviour
              jfclere