Hi,
for our product I needed to limit number of requests sent during each
backend connection. I'm sending short patch which adds new parameter
MaxKeepAliveRequests, e.g.:
Service
BackEnd
Address 127.0.0.1
Port 8080
MaxKeepAliveRequests 1
End
End
Reason in short -- we use proxy chain pound(1st)+haproxy(2nd) with
special behaviour. Pound is used for SSL decryption and maintaining
keep alive to clients only, HAproxy is balancing/routing traffic on
real backends. Connection to HAproxy must not be keepalive, because
the real backends are chosen for whole connection. Our solution is
based on strange seettings on HAproxy so that he forces closing the
TCP connection, but filters Connection: header from response. Snip
from HAproxy configuration for illustration:
...
frontend main 127.0.0.1:81
option forceclose
default_backend static
rspidel ^Connection:.*
...
This results in creating new connection to HAproxy from Pound, but
connection to Pound is persistent.
Problem was that under high load Pound sent second request into
channel, which was going to close (FIN was not received yet). That
request failed and client received HTTP 500 or similar error. With
attached patch you can specify (or not) how many requests can each
backend serve in one connection.
http://www.fi.muni.cz/~xholer/content/unix/pound-2.4.4-maxkeepaliverequests.patch
Feel free to use it if you find it useful.
Vlastimil Holer
--
http://www.fi.muni.cz/~holer
--
To unsubscribe send an email with subject unsubscribe to [email protected].
Please contact [email protected] for questions.