httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mathias Herberts" <mathias.herbe...@gmail.com>
Subject mod_proxy and balancer problems
Date Fri, 29 Sep 2006 07:53:00 GMT
Hi,

I am in the process of evaluating Apache 2.2 using mod_proxy_balancer
and mod_proxy_ajp as a replacement for our good old 1.3/mod_jk setup
as a front-end to Tomcat 5.5.

I found several problems during this process.

* redirect feature of balanced workers does not work as advertised.

The documentation for the redirect attribute states:

"Redirection Route of the worker. This value is usually set
dynamically to enable safe removal of the node from the cluster. If
set all requests without session id will be redirected to the
BalancerMember that has route parametar equal as this value."

But in the source I could only found uses of this attribute in
mod_proxy_balancer.c (find_session_route) where the associated code
is:

        worker = find_route_worker(balancer, *route);
        if (worker && !PROXY_WORKER_IS_USABLE(worker)) {
            /* We have a worker that is unusable.
             * It can be in error or disabled, but in case
             * it has a redirection set use that redirection worker.
             * This enables to safely remove the member from the
             * balancer. Of course you will need a some kind of
             * session replication between those two remote.
             */
            if (*worker->s->redirect)
                worker = find_route_worker(balancer, worker->s->redirect);
            /* Check if the redirect worker is usable */
            if (worker && !PROXY_WORKER_IS_USABLE(worker))
                worker = NULL;
        }
        return worker;

so basically what is being done is that if a request is part of a
session and thus has to be routed to a specific worker then, if that
worker is unsuable but has a redirection then use that worker instead
(if it is usable).

So redirection is only used when handling session bound requests which
is exactly the opposite of what the documentation said.

The goal of graceful worker shutdown is therefore not achieved as
there is no way to have session bound requests stick to their origin
worker and new requests to flow to another worker.

Having worked four years ago on the lb part of mod_jk I think a simple
redirect flag would be helpful, that is flag a worker as *redirected*
to have all requests not part of a session redirected to other
workers. This will allow for graceful worker shutdown as after having
marked a worker redirected only requests to sessions initiated on that
worker will be forwarded to it, no new sessions will be created,
therefore after a while this worker will have no traffic at all
(assuming sessions do expire...).

While investigating this problem I found another one, in the same
function (find_session_route), if a worker is diagnosed in error state
and all requests coming into Apache belong to sessions initiated in
this worker then the worker will never be retryed (see code above that
only checks for redirection).

I have other problems in stock for which I have produced patches, I
will talk about those later as they are not as critical as this one.

Anybody experienced the same problem with mod_proxy_balancer?

Regards,

Mathias.

Mime
View raw message