reset (initialize) and "age" their data, useful when
adding new workers, or when workers come back into
the fold....
Logic and code to come in a bit :)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@769020
13f79535-47bb-0310-9956-
ffa450edef68
}
+static apr_status_t reset(proxy_balancer *balancer, request_rec *r) {
+ return APR_SUCCESS;
+}
+
+static apr_status_t age(proxy_balancer *balancer, request_rec *r) {
+ return APR_SUCCESS;
+}
+
static const proxy_balancer_method bybusyness =
{
"bybusyness",
&find_best_bybusyness,
+ &reset,
+ &age,
NULL
};
return mycandidate;
}
+static apr_status_t reset(proxy_balancer *balancer, request_rec *r) {
+ return APR_SUCCESS;
+}
+
+static apr_status_t age(proxy_balancer *balancer, request_rec *r) {
+ return APR_SUCCESS;
+}
+
/*
* How to add additional lbmethods:
* 1. Create func which determines "best" candidate worker
{
"byrequests",
&find_best_byrequests,
+ &reset,
+ &age,
NULL
};
return mycandidate;
}
+static apr_status_t reset(proxy_balancer *balancer, request_rec *r) {
+ return APR_SUCCESS;
+}
+
+static apr_status_t age(proxy_balancer *balancer, request_rec *r) {
+ return APR_SUCCESS;
+}
+
static const proxy_balancer_method bytraffic =
{
"bytraffic",
&find_best_bytraffic,
+ &reset,
+ &age,
NULL
};
return mycandidate;
}
+static apr_status_t reset(proxy_balancer *balancer, request_rec *r) {
+ return APR_SUCCESS;
+}
+
+static apr_status_t age(proxy_balancer *balancer, request_rec *r) {
+ return APR_SUCCESS;
+}
+
static const proxy_balancer_method heartbeat =
{
"heartbeat",
&find_best_hb,
+ &reset,
+ &age,
NULL
};
const char *name; /* name of the load balancer method*/
proxy_worker *(*finder)(proxy_balancer *balancer,
request_rec *r);
+ apr_status_t (*reset)(proxy_balancer *balancer, request_rec *r);
+ apr_status_t (*age)(proxy_balancer *balancer, request_rec *r);
void *context; /* general purpose storage */
};
worker->hostname);
}
else {
+ if (worker->s->retries) {
+ }
worker->s->error_time = 0;
worker->s->retries = 0;
}