Apache mod_proxy: Parameter `acquire` doesn't work

1.7k views Asked by At

We use the apache2-worker package with mod_proxy, mod_proxy_balancer and mod_status. Apache is configured as a load balancer / dispatcher to WFS servers.

OS: SuSE SLES 11 SP2
Apache httpd: version 2.2.12

All of our workers (WFS servers) can handle only one request at a time. So in /etc/apache2/server-tuning.conf, section <IfModule worker.c>, we sat the parameter ServerLimit to 1. In the configuration of a BalancerMember we used the parameter max=1. I.e. /etc/apache2/conf.d/proxy.conf looks like that:

<Proxy balancer://wfscluster>
    BalancerMember http://wfsserver01:9090 max=1 timeout=3600 acquire=30000
    BalancerMember http://wfsserver01:9091 max=1 timeout=3600 acquire=30000
    BalancerMember http://wfsserver02:9090 max=1 timeout=3600 acquire=30000
</Proxy> 
ProxyPass /wfs balancer://wfscluster/ nofailover=On

The parameter acquire:

Documentation says:

If set this will be the maximum time to wait for a free connection in the connection pool, in milliseconds. If there are no free connections in the pool the Apache will return SERVER_BUSY status to the client.

My understanding of the parameter acquire is the following, and that my desired behaviour, too:

The load balancer gets some requests from clients. At some point in time all workers are busy. The next request remains on hold by the load balancer until a worker becomes free. If a worker becomes free the pending request is assigned to the free worker, which then accepts the connection. If there are no free workers in the time specified by parameter acquire the client gets an error response.

But the parameter acquire doesn't work as expected. The load balancer assignes the next request to a busy worker. Even if another worker gets free in the meantime, the request is still assigned to the busy worker an the client has to wait until the busy worker finished the current request and accepts the new one.

If you do a /etc/init.d/apache2 reload you get an error message in apaches error_log:

BalancerMember Acquire timeout has wrong format

After that message httpd dies. If you only start or restart the httpd you don't get that message and the httpd is alive.

I also tried to specify a unit like in acquire=30000ms. But the error remains. The only thing which helps is to remove the acquire parameter, but the described behaviour is the same.

So the question is:

  • How do I have to use the parameter acquire? Has someone a working example?
  • Do I have to use other parameters to get the desired behaviour?
0

There are 0 answers