</directivesynopsis>
<directivesynopsis>
-<name>BalancerMember</name>
-<description>Add a member to a load balancing group</description>
-<syntax>BalancerMember [<var>balancerurl</var>] <var>url</var> [<var
- >key=value [key=value ...]]</var></syntax>
-<contextlist><context>directory</context>
-</contextlist>
-<compatibility>BalancerMember is only available in Apache HTTP Server 2.2
+<name>BalancerGrowth</name>
+<description>Number of additional Balancers that can be added Post-configuration</description>
+ <syntax>BalancerGrowth <var>#</var></syntax>
+ <default>BalancerGrowth 5</default>
+ <contextlist><context>server config</context><context>virtual host</context></contextlist>
+<compatibility>BalancerGrowth is only available in Apache HTTP Server 2.3.13
and later.</compatibility>
<usage>
- <p>This directive adds a member to a load balancing group. It could be used
- within a <code><Proxy <var>balancer://</var>...></code> container
- 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
- module="mod_proxy">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
- member in question.</p>
- <p>The balancerurl is only needed when not in <code><Proxy <var>balancer://</var>...></code>
- container directive. It corresponds to the url of a balancer defined in
- <directive module="mod_proxy">ProxyPass</directive> directive.</p>
+ <p>This directive allows for growth potential in the number of
+ Balancers available for a virtualhost in addition to the
+ number pre-configured. It only take effect if there is at
+ least 1 pre-configured Balancer.</p>
</usage>
</directivesynopsis>
+<directivesynopsis>
+ <name>BalancerMember</name>
+ <description>Add a member to a load balancing group</description>
+ <syntax>BalancerMember [<var>balancerurl</var>] <var>url</var> [<var
+ >key=value [key=value ...]]</var></syntax>
+ <contextlist><context>directory</context>
+ </contextlist>
+ <compatibility>BalancerMember is only available in Apache HTTP Server 2.2
+ and later.</compatibility>
+ <usage>
+ <p>This directive adds a member to a load balancing group. It could be used
+ within a <code><Proxy <var>balancer://</var>...></code> container
+ 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
+ module="mod_proxy">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
+ member in question.</p>
+ <p>The balancerurl is only needed when not in <code><Proxy <var>balancer://</var>...></code>
+ container directive. It corresponds to the url of a balancer defined in
+ <directive module="mod_proxy">ProxyPass</directive> directive.</p>
+ </usage>
+</directivesynopsis>
+
<directivesynopsis>
<name>ProxySet</name>
<description>Set various Proxy balancer or member parameters</description>
* change AP_DECLARE to AP_CORE_DECLARE: ap_register_log_hooks()
* 20110329.2 (2.3.12-dev) Add child_status and end_generation hooks.
* 20110329.3 (2.3.12-dev) Add format field to ap_errorlog_info.
+ * 20110329.4 (2.3.13-dev) bgrowth and max_balancers to proxy_server_conf.
*/
#define MODULE_MAGIC_COOKIE 0x41503234UL /* "AP24" */
#ifndef MODULE_MAGIC_NUMBER_MAJOR
#define MODULE_MAGIC_NUMBER_MAJOR 20110329
#endif
-#define MODULE_MAGIC_NUMBER_MINOR 3 /* 0...n */
+#define MODULE_MAGIC_NUMBER_MINOR 4 /* 0...n */
/**
* Determine if the server's current MODULE_MAGIC_NUMBER is at least a
ps->viaopt = via_off; /* initially backward compatible with 1.3.1 */
ps->viaopt_set = 0; /* 0 means default */
ps->req = 0;
+ ps->max_balancers = 0;
+ ps->bgrowth = 5;
+ ps->bgrowth_set = 0;
ps->req_set = 0;
ps->recv_buffer_size = 0; /* this default was left unset for some reason */
ps->recv_buffer_size_set = 0;
ps->viaopt_set = overrides->viaopt_set || base->viaopt_set;
ps->req = (overrides->req_set == 0) ? base->req : overrides->req;
ps->req_set = overrides->req_set || base->req_set;
+ ps->bgrowth = (overrides->bgrowth_set == 0) ? base->bgrowth : overrides->bgrowth;
+ ps->bgrowth_set = overrides->bgrowth_set || base->bgrowth_set;
+ ps->max_balancers = overrides->max_balancers || base->max_balancers;
ps->recv_buffer_size = (overrides->recv_buffer_size_set == 0) ? base->recv_buffer_size : overrides->recv_buffer_size;
ps->recv_buffer_size_set = overrides->recv_buffer_size_set || base->recv_buffer_size_set;
ps->io_buffer_size = (overrides->io_buffer_size_set == 0) ? base->io_buffer_size : overrides->io_buffer_size;
return NULL;
}
+static const char *set_bgrowth(cmd_parms *parms, void *dummy, const char *arg)
+{
+ proxy_server_conf *psf =
+ ap_get_module_config(parms->server->module_config, &proxy_module);
+
+ int growth = atoi(arg);
+ if (growth < 0 || growth > 1000) {
+ return "BalancerGrowth must be between 0 and 1000";
+ }
+ psf->bgrowth = growth;
+ psf->bgrowth_set = 1;
+
+ return NULL;
+}
+
static const char *add_member(cmd_parms *cmd, void *dummy, const char *arg)
{
server_rec *s = cmd->server;
"How to handle bad header line in response: IsError | Ignore | StartBody"),
AP_INIT_RAW_ARGS("BalancerMember", add_member, NULL, RSRC_CONF|ACCESS_CONF,
"A balancer name and scheme with list of params"),
+ AP_INIT_TAKE1("BalancerGrowth", set_bgrowth, NULL, RSRC_CONF,
+ "Number of additional Balancers that can be added post-config"),
AP_INIT_TAKE1("ProxyStatus", set_status_opt, NULL, RSRC_CONF,
"Configure Status: proxy status to one of: on | off | full"),
AP_INIT_RAW_ARGS("ProxySet", set_proxy_param, NULL, RSRC_CONF|ACCESS_CONF,
const char *id;
apr_pool_t *pool; /* Pool used for allocating this struct */
int req; /* true if proxy requests are enabled */
+ int max_balancers; /* maximum number of allowed balancers */
+ int bgrowth; /* number of post-config balancers can added */
enum {
via_off,
via_on,
unsigned int badopt_set:1;
unsigned int proxy_status_set:1;
unsigned int source_address_set:1;
+ unsigned int bgrowth_set:1;
} proxy_server_conf;
conf = (proxy_server_conf *)ap_get_module_config(sconf, &proxy_module);
if (conf->balancers->nelts) {
- ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, "Doing balancers create: %d, %d",
+ conf->max_balancers = conf->balancers->nelts + conf->bgrowth;
+ ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, "Doing balancers create: %d, %d (%d)",
(int)ALIGNED_PROXY_BALANCER_SHARED_SIZE,
- (int)conf->balancers->nelts);
+ (int)conf->balancers->nelts, conf->max_balancers);
rv = storage->create(&new, conf->id,
ALIGNED_PROXY_BALANCER_SHARED_SIZE,
- conf->balancers->nelts, AP_SLOTMEM_TYPE_PREGRAB, pconf);
+ conf->max_balancers, AP_SLOTMEM_TYPE_PREGRAB, pconf);
if (rv != APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_EMERG, rv, s, "balancer slotmem_create failed");
return !OK;