From: Mladen Turk Date: Sat, 27 Nov 2004 19:56:40 +0000 (+0000) Subject: Add sample algorithm for scheduler and X-Git-Tag: 2.1.2~97 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6ec94af2f94c26e51d886b366e0660b679377f32;p=apache Add sample algorithm for scheduler and use
 for algorithm tables.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@106751 13f79535-47bb-0310-9956-ffa450edef68
---

diff --git a/docs/manual/mod/mod_proxy_balancer.html.en b/docs/manual/mod/mod_proxy_balancer.html.en
index 762a8b2eac..849ac171cc 100644
--- a/docs/manual/mod/mod_proxy_balancer.html.en
+++ b/docs/manual/mod/mod_proxy_balancer.html.en
@@ -80,95 +80,52 @@ load balancing 
 
     

If some workers are disabled, the others will still be scheduled correctly.

+
+for each worker in workers
+    worker lbstatus += worker lbfactor
+    total factor    += worker lbfactor
+    if worker lbstatus > candidate lbstatus
+       candidate = worker
 
+candidate lbstatus -= total factor
+
+    

If a balancer is configured as follows:

- - - - - - - - - - - - - - - -
workerabcd
lbfactor25252525
lbstatus0000
+

+    worker     a    b    c    d
+    lbfactor  25   25   25   25
+    lbstatus   0    0    0    0
+    

And b gets disabled, the following schedule is produced:

- - - - - - - - - - - - - - - - - - - - - - -
workerabcd
lbstatus-5002525
lbstatus-250-2550
lbstatus0000
(repeat)
- +

+    lbstatus -50    0   25   25
+    lbstatus -25    0  -25   50
+    lbstatus   0    0    0    0
+    (repeat)
+    

That is it schedules: a c d a c d a c d ...

The following asymmetric configuration works as one would expect:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
workerab
lbfactor7030
lbstatus-3030
lbstatus40-40
lbstatus10-10
lbstatus-2020
lbstatus-5050
lbstatus20-20
lbstatus-1010
lbstatus-4040
lbstatus30-30
lbstatus00
(repeat)
- -

That is after 10 schedules, the schedule repeats and 7 a are selected - with 3 b interspersed.

+

+    worker     a    b
+    lbfactor  70   30
+
+    lbstatus -30   30
+    lbstatus  40  -40
+    lbstatus  10  -10
+    lbstatus -20   20
+    lbstatus -50   50
+    lbstatus  20  -20
+    lbstatus -10   10
+    lbstatus -40   40
+    lbstatus  30  -30
+    lbasatus   0    0
+    (repeat)
+    
+ +

That is after 10 schedules, the schedule repeats and 7 a + are selected with 3 b interspersed.

top

Enabling Balancer Manager Support

diff --git a/docs/manual/mod/mod_proxy_balancer.xml b/docs/manual/mod/mod_proxy_balancer.xml index 403c36c13c..aa303f24f3 100644 --- a/docs/manual/mod/mod_proxy_balancer.xml +++ b/docs/manual/mod/mod_proxy_balancer.xml @@ -69,98 +69,52 @@ load balancing

If some workers are disabled, the others will still be scheduled correctly.

+
+for each worker in workers
+    worker lbstatus += worker lbfactor
+    total factor    += worker lbfactor
+    if worker lbstatus > candidate lbstatus
+       candidate = worker
 
+candidate lbstatus -= total factor
+
+    

If a balancer is configured as follows:

- - - - - - - - - - - - - - - - -
workerabcd
lbfactor25252525
lbstatus0000
+

+    worker     a    b    c    d
+    lbfactor  25   25   25   25
+    lbstatus   0    0    0    0
+    

And b gets disabled, the following schedule is produced:

- - - - - - - - - - - - - - - - - - - - - - - -
workerabcd
lbstatus-5002525
lbstatus-250-2550
lbstatus0000
(repeat)
- +

+    lbstatus -50    0   25   25
+    lbstatus -25    0  -25   50
+    lbstatus   0    0    0    0
+    (repeat)
+    

That is it schedules: a c d a c d a c d ...

The following asymmetric configuration works as one would expect:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
workerab
lbfactor7030
lbstatus-3030
lbstatus40-40
lbstatus10-10
lbstatus-2020
lbstatus-5050
lbstatus20-20
lbstatus-1010
lbstatus-4040
lbstatus30-30
lbstatus00
(repeat)
- -

That is after 10 schedules, the schedule repeats and 7 a are selected - with 3 b interspersed.

+

+    worker     a    b
+    lbfactor  70   30
+
+    lbstatus -30   30
+    lbstatus  40  -40
+    lbstatus  10  -10
+    lbstatus -20   20
+    lbstatus -50   50
+    lbstatus  20  -20
+    lbstatus -10   10
+    lbstatus -40   40
+    lbstatus  30  -30
+    lbasatus   0    0
+    (repeat)
+    
+ +

That is after 10 schedules, the schedule repeats and 7 a + are selected with 3 b interspersed.