Author: jfrederic.clere(a)jboss.com
Date: 2008-10-03 03:04:58 -0400 (Fri, 03 Oct 2008)
New Revision: 1929
Modified:
trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_cluster.c
Log:
Some more tries with the algo.
Modified: trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_cluster.c
===================================================================
--- trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_cluster.c 2008-10-02 20:35:33 UTC
(rev 1928)
+++ trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_cluster.c 2008-10-03 07:04:58 UTC
(rev 1929)
@@ -840,8 +840,10 @@
}
if (mycandidate) {
- if (mycandidate->s->lbstatus > - FORGETFACTOR *
mycandidate->s->lbfactor)
+ if ((mycandidate->s->lbstatus-total_factor) > - FORGETFACTOR *
mycandidate->s->lbfactor)
mycandidate->s->lbstatus -= total_factor;
+ else
+ mycandidate->s->lbstatus = - FORGETFACTOR *
mycandidate->s->lbfactor;
mycandidate->s->elected++;
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
"proxy: byrequests balancer DONE (%s)",
mycandidate->name);
@@ -1537,8 +1539,10 @@
}
workers++;
}
- if (runtime->s->lbstatus > - FORGETFACTOR * runtime->s->lbfactor)
+ if (runtime->s->lbstatus-total_factor > - FORGETFACTOR *
runtime->s->lbfactor)
runtime->s->lbstatus -= total_factor;
+ else
+ runtime->s->lbstatus = - FORGETFACTOR * runtime->s->lbfactor;
runtime->s->elected++;
*worker = runtime;
Show replies by date