DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUGĀ·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=36138>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED ANDĀ·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=36138

           Summary: mod_jk load balance algorithm that accounts for current
                    worker load
           Product: Tomcat 5
           Version: Unknown
          Platform: All
        OS/Version: other
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Native:JK
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: [EMAIL PROTECTED]


This is the mod_jk patch I mentioned on the tomcat-dev mailing list on August 
6.

The patch adds a new lb.method option 'B' for 'Busyness'.  The algorithm picks 
the lbworker with the lowest current load, based on how many requests the 
worker is currently serving (the "Busy" column in the jkstatus page).  This 
number is divided by the worker's lbfactor, and the lowest value (least busy) 
worker is picked.  

We tested about 25-30 threads against 6 load-balanced tomcats with requests 
that take about 250ms each to complete.  Using the "Busyness" algorithm 
improved our throughput from 12-16 requests per second to 60+ requests per 
second, and watching the jkstatus page showed that all servers were 
kept "evenly" busy.  If one particular server started lagging, its Busy value 
increased, so it received fewer requests.  If a request is received when none 
of the workers are busy, this algorithm is effectively an evenly-weighted 
round-robin.

Note that we found some race conditions with the code that updates the various 
lb status values, especially the lbworker "busy" value, which our algorithm 
requires to be accurate.  To fix this, we had to refactor some of the shared 
memory and critical-section locking code, by moving the lock into 
get_most_suitable_worker() (jk_lb_worker.c).  We also found some problems that 
would cause the 'busy' value to be set to less than zero (displaying MAX_INT - 
1, for example, in jkstatus).

We fixed this by setting the busy value to 0 if it is ever less than 0.  See 
jk_lb_worker.c lines 389-400.

Finally, we added a new column to the jkstatus page.  The "Ssc" column now 
reports the number of times the worker was reused from sticky session.  See 
jk_shm.c line 89, and jk_lb_worker.c line 584.  

We have load-tested this patch under apache 2.0.50, and we've also been 
running it in a busy production site for almost a week.  

This patch is donated by Andrew Hudson and Chris Lamprecht.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to