Hi,

I'm evaluating mod_jk1.2.19 with 8 Tomcat application servers.
I found problems about loadbalancing method.


* method=Request

Suddenly, balancing wouldn't be equally.
When the requests were concentrated a particular Tomcat server (e.g.
tomcat1). It was caused by sticky session when a particular user
accessed a lot, user accessed the page that contains a lot of images,
and so on.
After that, mod_jk concentrated the requests to other Tomcat servers.
So tomcat1 would have idle time.

Here is the data of CPU usage when I ran the test with 2 Tomcat servers.
http://jbento.sourceforge.net/modjk/CLIENT_200.html
Sometime, tomcat1 had high CPU usage, but tomcat2 had idle.
They worked alternately.


* method=Busyness

Balancing cannot be equally when Apache has been restarted.
Because mod_jk has the offset value that is used to set the start
point of searching endpoints on each Apache process. So, each process
selects a particular Tomcat server that is the top of the endpoint
list.

Here is the summary of jk-status report.

Name V Acc Err
kuma03 0 9075 0
kuma04 0 10013 0
kuma05 0 9199 0
kuma06 0 8996 0
kuma07 0 8914 0
kuma08 0 7043 0
kuma09 0 6234 0
kuma10 0 5260 0

kuma10 is the bottom of endpoint list and it didn't work so much.

--
So, in my opinion, lb_value should be counted up when the request
doesn't have the sessionid. It is advisability because the sticky
session causes the status concentrated.

I made the patch to make the new method "Session".
I run the tests and the requests were balanced equally.

Thanks.

-Takayuki
Index: jk/native/common/jk_util.c
===================================================================
--- jk/native/common/jk_util.c  (revision 475677)
+++ jk/native/common/jk_util.c  (working copy)
@@ -932,6 +932,8 @@
         return JK_LB_METHOD_REQUESTS;
     else if  (*v == 'b' || *v == 'B' || *v == '2')
         return JK_LB_METHOD_BUSYNESS;
+    else if  (*v == 's' || *v == 'S' || *v == '3')
+        return JK_LB_METHOD_SESSION;
     else
         return JK_LB_METHOD_DEF;
 }
Index: jk/native/common/jk_lb_worker.c
===================================================================
--- jk/native/common/jk_lb_worker.c     (revision 475677)
+++ jk/native/common/jk_lb_worker.c     (working copy)
@@ -55,6 +55,7 @@
     JK_LB_METHOD_TEXT_REQUESTS,
     JK_LB_METHOD_TEXT_TRAFFIC,
     JK_LB_METHOD_TEXT_BUSYNESS,
+    JK_LB_METHOD_TEXT_SESSION,
     NULL
 };
 
@@ -799,6 +800,8 @@
                 rec->s->busy++;
                 if (p->worker->lbmethod == JK_LB_METHOD_REQUESTS)
                     rec->s->lb_value += rec->s->lb_mult;
+                else if (p->worker->lbmethod == JK_LB_METHOD_SESSION && 
!sessionid)
+                    rec->s->lb_value += rec->s->lb_mult;
                 else if (p->worker->lbmethod == JK_LB_METHOD_BUSYNESS)
                     rec->s->lb_value += rec->s->lb_mult;
                 if (rec->s->busy > rec->s->max_busy)
Index: jk/native/common/jk_lb_worker.h
===================================================================
--- jk/native/common/jk_lb_worker.h     (revision 475677)
+++ jk/native/common/jk_lb_worker.h     (working copy)
@@ -42,10 +42,12 @@
 #define JK_LB_METHOD_REQUESTS          (1)
 #define JK_LB_METHOD_TRAFFIC           (2)
 #define JK_LB_METHOD_BUSYNESS          (3)
+#define JK_LB_METHOD_SESSION          (4)
 #define JK_LB_METHOD_DEF               (JK_LB_METHOD_REQUESTS)
 #define JK_LB_METHOD_TEXT_REQUESTS     ("Request")
 #define JK_LB_METHOD_TEXT_TRAFFIC      ("Traffic")
 #define JK_LB_METHOD_TEXT_BUSYNESS     ("Busyness")
+#define JK_LB_METHOD_TEXT_SESSION      ("Session")
 #define JK_LB_METHOD_TEXT_DEF          (JK_LB_METHOD_TEXT_REQUESTS)
 #define JK_LB_LOCK_OPTIMISTIC          (1)
 #define JK_LB_LOCK_PESSIMISTIC         (2)
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to