You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by mt...@apache.org on 2004/11/27 20:56:40 UTC

svn commit: r106751 - /httpd/httpd/trunk/docs/manual/mod/mod_proxy_balancer.html.en /httpd/httpd/trunk/docs/manual/mod/mod_proxy_balancer.xml

Author: mturk
Date: Sat Nov 27 11:56:40 2004
New Revision: 106751

URL: http://svn.apache.org/viewcvs?view=rev&rev=106751
Log:
Add sample algorithm for scheduler and
use <pre><code> for algorithm tables.
Modified:
   httpd/httpd/trunk/docs/manual/mod/mod_proxy_balancer.html.en
   httpd/httpd/trunk/docs/manual/mod/mod_proxy_balancer.xml

Modified: httpd/httpd/trunk/docs/manual/mod/mod_proxy_balancer.html.en
Url: http://svn.apache.org/viewcvs/httpd/httpd/trunk/docs/manual/mod/mod_proxy_balancer.html.en?view=diff&rev=106751&p1=httpd/httpd/trunk/docs/manual/mod/mod_proxy_balancer.html.en&r1=106750&p2=httpd/httpd/trunk/docs/manual/mod/mod_proxy_balancer.html.en&r2=106751
==============================================================================
--- httpd/httpd/trunk/docs/manual/mod/mod_proxy_balancer.html.en	(original)
+++ httpd/httpd/trunk/docs/manual/mod/mod_proxy_balancer.html.en	Sat Nov 27 11:56:40 2004
@@ -80,95 +80,52 @@
 
     <p>If some workers are disabled, the others will
     still be scheduled correctly.</p>
+    <div class="example"><pre>
+for each worker in workers
+    worker lbstatus += worker lbfactor
+    total factor    += worker lbfactor
+    if worker lbstatus &gt; candidate lbstatus
+       candidate = worker
 
+candidate lbstatus -= total factor
+
+    </pre></div>
     <p>If a balancer is configured as follows:</p>
     
-    <table><tr><th>worker</th>
-        <th class="data">a</th>
-        <th class="data">b</th>
-        <th class="data">c</th>
-        <th class="data">d</th></tr>
-<tr><th>lbfactor</th>
-        <td class="data">25</td>
-        <td class="data">25</td>
-        <td class="data">25</td>
-        <td class="data">25</td></tr>
-<tr><th>lbstatus</th>
-        <td class="data">0</td>
-        <td class="data">0</td>
-        <td class="data">0</td>
-        <td class="data">0</td></tr>
-</table>
+    <pre><code>
+    worker     a    b    c    d
+    lbfactor  25   25   25   25
+    lbstatus   0    0    0    0
+    </code></pre>
 
     <p>And <var>b</var> gets disabled, the following schedule is produced:</p>
-
-    <table><tr><th>worker</th>
-        <th class="data">a</th>
-        <th class="data">b</th>
-        <th class="data">c</th>
-        <th class="data">d</th></tr>
-<tr><th>lbstatus</th>
-        <td class="data">-50</td>
-        <td class="data">0</td>
-        <td class="data">25</td>
-        <td class="data">25</td></tr>
-<tr><th>lbstatus</th>
-        <td class="data">-25</td>
-        <td class="data">0</td>
-        <td class="data">-25</td>
-        <td class="data">50</td></tr>
-<tr><th>lbstatus</th>
-        <td class="data">0</td>
-        <td class="data">0</td>
-        <td class="data">0</td>
-        <td class="data">0</td></tr>
-<tr><td class="data" colspan="5">(repeat)</td></tr>
-</table>
-
+    <pre><code>
+    lbstatus <strong>-50</strong>    0   25   25
+    lbstatus -25    0  <strong>-25</strong>   50
+    lbstatus   0    0    0    <strong>0</strong>
+    (repeat)
+    </code></pre>
     <p>That is it schedules: a c d a c d a c d ...</p>
     <p>The following asymmetric configuration works as one would expect:</p>
+    <pre><code>
+    worker     a    b
+    lbfactor  70   30
+
+    lbstatus <strong>-30</strong>   30
+    lbstatus  40  <strong>-40</strong>
+    lbstatus  <strong>10</strong>  -10
+    lbstatus <strong>-20</strong>   20
+    lbstatus <strong>-50</strong>   50
+    lbstatus  20  <strong>-20</strong>
+    lbstatus <strong>-10</strong>   10
+    lbstatus <strong>-40</strong>   40
+    lbstatus  30  <strong>-30</strong>
+    lbasatus   <strong>0</strong>    0
+    (repeat)
+    </code></pre>
 
-    <table><tr><th>worker</th>
-        <th class="data">a</th>
-        <th class="data">b</th></tr>
-<tr><th>lbfactor</th>
-        <td class="data">70</td>
-        <td class="data">30</td></tr>
-<tr><th>lbstatus</th>
-        <td class="data">-30</td>
-        <td class="data">30</td></tr>
-<tr><th>lbstatus</th>
-        <td class="data">40</td>
-        <td class="data">-40</td></tr>
-<tr><th>lbstatus</th>
-        <td class="data">10</td>
-        <td class="data">-10</td></tr>
-<tr><th>lbstatus</th>
-        <td class="data">-20</td>
-        <td class="data">20</td></tr>
-<tr><th>lbstatus</th>
-        <td class="data">-50</td>
-        <td class="data">50</td></tr>
-<tr><th>lbstatus</th>
-        <td class="data">20</td>
-        <td class="data">-20</td></tr>
-<tr><th>lbstatus</th>
-        <td class="data">-10</td>
-        <td class="data">10</td></tr>
-<tr><th>lbstatus</th>
-        <td class="data">-40</td>
-        <td class="data">40</td></tr>
-<tr><th>lbstatus</th>
-        <td class="data">30</td>
-        <td class="data">-30</td></tr>
-<tr><th>lbstatus</th>
-        <td class="data">0</td>
-        <td class="data">0</td></tr>
-<tr><td class="data" colspan="3">(repeat)</td></tr>
-</table>
-
-    <p>That is after 10 schedules, the schedule repeats and 7 a are selected
-    with 3 b interspersed.</p>
+    <p>That is after 10 schedules, the schedule repeats and 7 <var>a</var>
+    are selected with 3 <var>b</var> interspersed.</p>
 </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
 <div class="section">
 <h2><a name="enable" id="enable">Enabling Balancer Manager Support</a></h2>

Modified: httpd/httpd/trunk/docs/manual/mod/mod_proxy_balancer.xml
Url: http://svn.apache.org/viewcvs/httpd/httpd/trunk/docs/manual/mod/mod_proxy_balancer.xml?view=diff&rev=106751&p1=httpd/httpd/trunk/docs/manual/mod/mod_proxy_balancer.xml&r1=106750&p2=httpd/httpd/trunk/docs/manual/mod/mod_proxy_balancer.xml&r2=106751
==============================================================================
--- httpd/httpd/trunk/docs/manual/mod/mod_proxy_balancer.xml	(original)
+++ httpd/httpd/trunk/docs/manual/mod/mod_proxy_balancer.xml	Sat Nov 27 11:56:40 2004
@@ -69,98 +69,52 @@
 
     <p>If some workers are disabled, the others will
     still be scheduled correctly.</p>
+    <example><pre>
+for each worker in workers
+    worker lbstatus += worker lbfactor
+    total factor    += worker lbfactor
+    if worker lbstatus > candidate lbstatus
+       candidate = worker
 
+candidate lbstatus -= total factor
+
+    </pre></example>
     <p>If a balancer is configured as follows:</p>
     
-    <table style="data">
-    <tr><th>worker</th>
-        <th>a</th>
-        <th>b</th>
-        <th>c</th>
-        <th>d</th></tr>
-    <tr><th>lbfactor</th>
-        <td>25</td>
-        <td>25</td>
-        <td>25</td>
-        <td>25</td></tr>
-    <tr><th>lbstatus</th>
-        <td>0</td>
-        <td>0</td>
-        <td>0</td>
-        <td>0</td></tr>
-    </table>
+    <pre><code>
+    worker     a    b    c    d
+    lbfactor  25   25   25   25
+    lbstatus   0    0    0    0
+    </code></pre>
 
     <p>And <var>b</var> gets disabled, the following schedule is produced:</p>
-
-    <table style="data">
-    <tr><th>worker</th>
-        <th>a</th>
-        <th>b</th>
-        <th>c</th>
-        <th>d</th></tr>
-    <tr><th>lbstatus</th>
-        <td>-50</td>
-        <td>0</td>
-        <td>25</td>
-        <td>25</td></tr>
-    <tr><th>lbstatus</th>
-        <td>-25</td>
-        <td>0</td>
-        <td>-25</td>
-        <td>50</td></tr>
-    <tr><th>lbstatus</th>
-        <td>0</td>
-        <td>0</td>
-        <td>0</td>
-        <td>0</td></tr>
-    <tr><td colspan="5">(repeat)</td></tr>
-    </table>
-
+    <pre><code>
+    lbstatus <strong>-50</strong>    0   25   25
+    lbstatus -25    0  <strong>-25</strong>   50
+    lbstatus   0    0    0    <strong>0</strong>
+    (repeat)
+    </code></pre>
     <p>That is it schedules: a c d a c d a c d ...</p>
     <p>The following asymmetric configuration works as one would expect:</p>
+    <pre><code>
+    worker     a    b
+    lbfactor  70   30
+
+    lbstatus <strong>-30</strong>   30
+    lbstatus  40  <strong>-40</strong>
+    lbstatus  <strong>10</strong>  -10
+    lbstatus <strong>-20</strong>   20
+    lbstatus <strong>-50</strong>   50
+    lbstatus  20  <strong>-20</strong>
+    lbstatus <strong>-10</strong>   10
+    lbstatus <strong>-40</strong>   40
+    lbstatus  30  <strong>-30</strong>
+    lbasatus   <strong>0</strong>    0
+    (repeat)
+    </code></pre>
 
-    <table style="data">
-    <tr><th>worker</th>
-        <th>a</th>
-        <th>b</th></tr>
-    <tr><th>lbfactor</th>
-        <td>70</td>
-        <td>30</td></tr>
-    <tr><th>lbstatus</th>
-        <td>-30</td>
-        <td>30</td></tr>
-    <tr><th>lbstatus</th>
-        <td>40</td>
-        <td>-40</td></tr>
-    <tr><th>lbstatus</th>
-        <td>10</td>
-        <td>-10</td></tr>
-    <tr><th>lbstatus</th>
-        <td>-20</td>
-        <td>20</td></tr>
-    <tr><th>lbstatus</th>
-        <td>-50</td>
-        <td>50</td></tr>
-    <tr><th>lbstatus</th>
-        <td>20</td>
-        <td>-20</td></tr>
-    <tr><th>lbstatus</th>
-        <td>-10</td>
-        <td>10</td></tr>
-    <tr><th>lbstatus</th>
-        <td>-40</td>
-        <td>40</td></tr>
-    <tr><th>lbstatus</th>
-        <td>30</td>
-        <td>-30</td></tr>
-    <tr><th>lbstatus</th>
-        <td>0</td>
-        <td>0</td></tr>
-    <tr><td colspan="3">(repeat)</td></tr>
-    </table>
-
-    <p>That is after 10 schedules, the schedule repeats and 7 a are selected
-    with 3 b interspersed.</p>
+    <p>That is after 10 schedules, the schedule repeats and 7 <var>a</var>
+    are selected with 3 <var>b</var> interspersed.</p>
 </section>
 
 <section id="enable">