I am having some issues with an apache proxying to a local tomcat instance.
The i have traced the issue down to the way maxclients and proxypass direvtives interact.
in a test environment I set up apache to have 3 max clients and proxypass to have a max of 2 connections to the ajp connector.
maxclients 3
proxypass /player ajp://localhost:8009/player max=2
To illustrate the issue I have firewalled 8009 so requests will have to timeout If I then make 3 requests to /player and one to a non-proxied file ( 4 in total ) What I expect to happen is this:
- 1st request recieved and proxyied
- 2nd request received and proxied
- 3rd request recieved and as proxypass max reached request queued
- 4th request recieved and served as normal
- 1st request times out
- 3rd request taken from queue and proxied
However What actually happens is this:
- 1st request recieved and proxyied
- 2nd request received and proxied
- 3rd request recieved and waits for proxy connection to free
- 4th request recieved and queued as max clients reached
- 1st request times out
- 3rd request processed
- 4th request served
Does anyone know how to force the apache worker to re-queue a request when max proxy connections has been reached so it can move on to non proxied requests?
Thanks
Pete