On Apr 9, 2006, at 03:34, Ruediger Pluem wrote:
As I investigated this one thing came up to my mind:

If you use the proxy in the way described above the '*' worker will be used which will be created automatically. Having the generic '*' available is a good thing, BUT this is not optimal from the performance point of view in these situations as the '*' worker has changing remote addresses and thus does not benefit from keepalives to the backend as much as it could. OTOH ProxyPass which creates explicit workers does not know regular expressions and is not well suited for more complex situations. The only other way to create a worker for a defined target is to add a BalancerMember to a
balanced backend.
So what about adding a directive called ProxyAddWorker that just defines a worker?
This would enable the following configuration:

     Listen 192.168.100.22:80

     ProxyAddWorker http://192.168.100.66:8099/ max=10
     ProxyAddWorker http://127.0.0.1:8080/ max=20

     <VirtualHost 192.168.100.22:80>
             ServerName www.domain.com

             RewriteEngine On
RewriteRule ^/external/(.*) http:// 192.168.100.66:8099/$1 [P] RewriteRule ^/(.*) http://127.0.0.1:8080/ $1 [P]
     </VirtualHost>

Of course ProxyAddWorker should not be mandatory. If the worker is not defined
the '*' worker should still be used.

You can get the same effect by using BalancerMember, right?

        RewriteRule ^/external/(.*)             balancer://external/$1 [P]
        RewriteRule  ^/(.*)                     balancer://main/$1 [P]

        <Proxy balancer://external>
                BalancerMember          http://192.168.100.66:8099/     max=10
        </Proxy>
        <Proxy balancer://main>
                BalancerMember          http://127.0.0.1:8080/$1        max=20
        </Proxy>

This is probably good enough, and it's also more flexible in that I could have multiple workers for one proxy destination (maybe to different web apps at different URIs on the same server) with different settings.

It might be good to change the names of these, though, e.g., BalancerMember -> ProxyWorker, and perhaps Proxy -> ProxySet, so they don't sound so "load-balancer" loaded (pun intended). :) (Then balancer maybe should be proxy or set as well.)

I think a more important new feature would be to make 'max' be the absolute max number of requests Apache will make to backends, not just the max per process. It's quite confusing the way it is : ( (But I understand you mentioned this is a difficult change.)

Btw, Ruediger, if you ever happen to come by Beijing (where I'm now), beers are on me for as long as you like :)

Rgds,
Bjorn

Reply via email to