You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2007/12/28 07:09:19 UTC

DO NOT REPLY [Bug 44147] New: - Multiple load balancing workers problem

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=44147>.
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=44147

           Summary: Multiple load balancing workers problem
           Product: Tomcat 5
           Version: Unknown
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: major
          Priority: P2
         Component: Native:JK
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: zealot0630@gmail.com


If there are 2 workers, and first has 10 members, second has 2 members.

in ./native/common/jk_lb_worker.c:find_best_byvalue
Consider the following scenario.
1.first worker has handled 6 requests, next_offset=6.
2.now there comes a request redirecting to second worker, next_offset jumps to 1.
3.next request redirect to first worker will be assigned to the second member,
the other member will never be used.

-- 
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: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 44147] - Multiple load balancing workers problem

Posted by bu...@apache.org.
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=44147>.
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=44147





------- Additional Comments From zealot0630@gmail.com  2007-12-27 22:11 -------
Created an attachment (id=21325)
 --> (http://issues.apache.org/bugzilla/attachment.cgi?id=21325&action=view)
The patch to fix this problem


-- 
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: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 44147] - Multiple load balancing workers problem

Posted by bu...@apache.org.
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=44147>.
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=44147


rainer.jung@kippdata.de changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED




------- Additional Comments From rainer.jung@kippdata.de  2007-12-31 11:38 -------
Thank you for reporting the problem. Your patch has been applied in a slightly
modified form and will be released as part of version 1.2.27:

http://svn.apache.org/viewvc?rev=607768&view=rev

Since we released 1.2.26 only a week ago, it might take 2-4 months until 1.2.27.

Please note: the problem you describe is not a serious one. Although the code
was not really correct, it will be hard to observe this problem in reality. The
algorithm will always search through all available members of a load balancer in
order to find the member with the least load. next_offset is *only* really
useful when one uses the busyness algorithm for balancing (which is not the
default).

If one uses busyness, and the load is low, it is likely, that several workers
have the same load value (=busyness), most likely the value 0. Let's assume for
simplicity, that all members always have busyness 0. Without next_offset, we
would then always choose the first member of a balancer. That would be OK,
because whenever we have to choose a member, there would be no load at all. But
still it would be counterintuitive to always choose the same member with a load
balancer. So next_offset rotates the starting point of the search loop in order
to make the decision between members of the same load status a little more balanced.

It would be even more correct, to put next_offset into the shared memory data of
the lb, to make it shared between all processes. I decided to *not* do that,
because there is a tradeoff between the additional overhead of a shared memory
volatile on the one hand and slightly better balancing for busyness+prefork+low
load on the other hand.

-- 
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: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org