Apache mod_proxy: 'acquire' option not working
We are using the apache2-worker package with mod_proxy, mod_proxy_balancer and mod_status. Apache is configured as a load balancer / manager for WFS servers.
OS: SuSE SLES 11 SP2
Apache httpd: version 2.2.12
All of our workers (WFS servers) can only handle one request at a time. So in section /etc/apache2/server-tuning.conf
, section <IfModule worker.c>
, we have executed the parameter ServerLimit
before 1
. In the BalancerMember configuration, we used the parameter max=1
. That is, /etc/apache2/conf.d/proxy.conf
it looks like this:
<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
Parameter acquire
:
The 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, Apache will return SERVER_BUSY status to the client.
My understanding of the parameter is as acquire
follows, and so is my desired behavior:
The load balancer receives some requests from clients. At some point, all workers are busy. The next request remains suspended by the load balancer until the worker is free. If the worker becomes free, the pending request is assigned to the free worker, who then accepts the connection. If there are no free workers within the time specified by the parameter acquire
, the client receives an error response.
But the parameter acquire
doesn't work as expected. The load balancer assigns the next request to a busy worker. Even if another worker is released, nevertheless, the request is still assigned to the busy worker and the client must wait for the busy worker to finish the current request and accept a new one.
If you do /etc/init.d/apache2 reload
, you get an error in apache error_log:
BalancerMember Acquisition timeout is not in the correct format
After that, the httpd message dies. If you only start or restart httpd, you don't get this message and httpd is alive.
I also tried to specify the unit as in acquire=30000ms
. But the error remains. The only thing that helps is to remove the parameter acquire
, but the described behavior will be the same.
So the question is:
- How do I use the parameter
acquire
? Does anyone have a working example? - Do I need to use other parameters to get the desired behavior?
source to share
No one has answered this question yet
Check out similar questions: