length in a password file.
[Luca Toscano, Hanno Böck <hanno hboeck de>]
+ *) mod_proxy: loadfactor parameter can now be a decimal number (eg: 1.25).
+ [Jim Jagielski]
+
*) mod_proxy_wstunnel: Allow upgrade to any protocol dynamically.
PR 61142.
PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
[ start all new proposals below, under PATCHES PROPOSED. ]
- *) mod_proxy: Loadfactor can now be a decimal number (eg: 1.25)
- trunk patch: http://svn.apache.org/r1805188
- http://svn.apache.org/r1805190
- http://svn.apache.org/r1805206 (partial)
- http://svn.apache.org/r1808723
- 2.4.x patch: http://home.apache.org/~jim/patches/httpd-2.4-loadfactor-v2.patch
- +1: jim, humbedooh, ylavic
- ylavic: conflicts on the docs, addressable while backporting I guess.
-
*) mod_speling: Don't embed Referer data in link in error page.
trunk patch: http://svn.apache.org/r1808780
2.4.x: trunk patch applies
directive and can take any of the key value pair parameters available to
<directive module="mod_proxy">ProxyPass</directive> directives.</p>
<p>One additional parameter is available only to <directive>BalancerMember</directive> directives:
- <var>loadfactor</var>. This is the member load factor - a number between 1
- (default) and 100, which defines the weighted load to be applied to the
+ <var>loadfactor</var>. This is the member load factor - a decimal number between 1.0
+ (default) and 100.0, which defines the weighted load to be applied to the
member in question.</p>
<p>The <var>balancerurl</var> is only needed when not within a
<code><Proxy <var>balancer://</var>...></code>
ProxyPass "/" "balancer://hotcluster/"
<Proxy "balancer://hotcluster">
BalancerMember "ajp://1.2.3.4:8009" loadfactor=1
- BalancerMember "ajp://1.2.3.5:8009" loadfactor=2
+ BalancerMember "ajp://1.2.3.5:8009" loadfactor=2.25
# The server below is on hot standby
BalancerMember "ajp://1.2.3.6:8009" status=+H
ProxySet lbmethod=bytraffic
/* Normalized load factor. Used with BalancerMember,
* it is a number between 1 and 100.
*/
- ival = atoi(val);
+ double fval = atof(val);
+ ival = fval * 100.0;
if (ival < 1 || ival > 100)
return "LoadFactor must be a number between 1..100";
worker->s->lbfactor = ival;
ap_rvputs(r, ap_proxy_parse_wstatus(r->pool, *worker), NULL);
ap_rvputs(r, "</td><td>", (*worker)->s->route, NULL);
ap_rvputs(r, "</td><td>", (*worker)->s->redirect, NULL);
- ap_rprintf(r, "</td><td>%d</td>", (*worker)->s->lbfactor);
+ ap_rprintf(r, "</td><td>%.2f</td>", (float)((*worker)->s->lbfactor)/100.0);
ap_rprintf(r, "<td>%d</td>", (*worker)->s->lbset);
ap_rprintf(r, "<td>%" APR_SIZE_T_FMT "</td><td>",
(*worker)->s->elected);
/* Recalculate lbfactors */
workers = (proxy_worker **)balancer->workers->elts;
/* Special case if there is only one worker its
- * load factor will always be 1
+ * load factor will always be 100
*/
if (balancer->workers->nelts == 1) {
- (*workers)->s->lbstatus = (*workers)->s->lbfactor = 1;
+ (*workers)->s->lbstatus = (*workers)->s->lbfactor = 100;
return;
}
for (i = 0; i < balancer->workers->nelts; i++) {
ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(01192) "settings worker params");
if ((val = apr_table_get(params, "w_lf"))) {
- int ival = atoi(val);
- if (ival >= 1 && ival <= 100) {
+ int ival;
+ double fval = atof(val);
+ ival = fval * 100.0;
+ if (ival >= 100 && ival <= 10000) {
wsel->s->lbfactor = ival;
if (bsel)
recalc_factors(bsel);
"</httpd:scheme>\n", NULL);
ap_rvputs(r, " <httpd:hostname>", worker->s->hostname,
"</httpd:hostname>\n", NULL);
- ap_rprintf(r, " <httpd:loadfactor>%d</httpd:loadfactor>\n",
- worker->s->lbfactor);
+ ap_rprintf(r, " <httpd:loadfactor>%.2f</httpd:loadfactor>\n",
+ (float)(worker->s->lbfactor)/100.0);
ap_rprintf(r,
" <httpd:port>%d</httpd:port>\n",
worker->s->port);
" <httpd:lbstatus>%d</httpd:lbstatus>\n",
worker->s->lbstatus);
ap_rprintf(r,
- " <httpd:loadfactor>%d</httpd:loadfactor>\n",
- worker->s->lbfactor);
+ " <httpd:loadfactor>%.2f</httpd:loadfactor>\n",
+ (float)(worker->s->lbfactor)/100.0);
ap_rprintf(r,
" <httpd:transferred>%" APR_OFF_T_FMT "</httpd:transferred>\n",
worker->s->transferred);
NULL);
ap_rvputs(r, "</td><td>",
ap_escape_html(r->pool, worker->s->redirect), NULL);
- ap_rprintf(r, "</td><td>%d</td>", worker->s->lbfactor);
+ ap_rprintf(r, "</td><td>%.2f</td>", (float)(worker->s->lbfactor)/100.0);
ap_rprintf(r, "<td>%d</td><td>", worker->s->lbset);
ap_rvputs(r, ap_proxy_parse_wstatus(r->pool, worker), NULL);
ap_rputs("</td>", r);
ap_rputs("<form method='POST' enctype='application/x-www-form-urlencoded' action='", r);
ap_rvputs(r, ap_escape_uri(r->pool, action), "'>\n", NULL);
ap_rputs("<table><tr><td>Load factor:</td><td><input name='w_lf' id='w_lf' type=text ", r);
- ap_rprintf(r, "value='%d'></td></tr>\n", wsel->s->lbfactor);
+ ap_rprintf(r, "value='%.2f'></td></tr>\n", (float)(wsel->s->lbfactor)/100.0);
ap_rputs("<tr><td>LB Set:</td><td><input name='w_ls' id='w_ls' type=text ", r);
ap_rprintf(r, "value='%d'></td></tr>\n", wsel->s->lbset);
ap_rputs("<tr><td>Route:</td><td><input name='w_wr' id='w_wr' type=text ", r);
wshared->flush_packets = flush_off;
wshared->flush_wait = PROXY_FLUSH_WAIT;
wshared->is_address_reusable = 1;
- wshared->lbfactor = 1;
+ wshared->lbfactor = 100;
wshared->passes = 1;
wshared->fails = 1;
wshared->interval = apr_time_from_sec(HCHECK_WATHCHDOG_DEFAULT_INTERVAL);