httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ruediger Pluem <rpl...@apache.org>
Subject Copied workers in balancer?
Date Fri, 14 Apr 2006 11:04:56 GMT

While investigating PR 38227
(http://issues.apache.org/bugzilla/show_bug.cgi?id=38227) I stumbled accross
ap_proxy_add_worker_to_balancer:

PROXY_DECLARE(void)
ap_proxy_add_worker_to_balancer(apr_pool_t *pool, proxy_balancer *balancer,
                                proxy_worker *worker)
{
    proxy_worker *runtime;

    runtime = apr_array_push(balancer->workers);
    memcpy(runtime, worker, sizeof(proxy_worker));
    runtime->id = proxy_lb_workers;
    /* Increase the total runtime count */
    proxy_lb_workers++;

}

Does anybody remember why we are making a copy of the worker?
This means that if you are only using a balancer you have the workers
twice (one in the balancer, one in the worker list). This seems to be
a waste of resources.
Even if you use a worker inside *and* outside a balancer, would it hurt
if these are the same?
>From a first glance I would say that some changes need to be done to avoid
a copy. The current approach seems to be at least somewhat convenient
from the developer side to handle the members of a balancer easily.


Regards

RĂ¼diger


Mime
View raw message