I'm trying to wrap my head around how the haproxy options
timeout http-request <timeout>
timeout http-keep-alive <timeout>
timeout server <timeout>
interact with each other. I'm running an Apache website on two app servers living behind a haproxy load balancer. Right now I don't have keep-alive enabled, but I've been experimenting with enabling it because I think it would help optimize the site. My goal was to enable keep-alive for connection between the browser and haproxy, but disable keep-alive between haproxy and apache. I accomplished this with
option http-server-close
Now I'm looking into setting up the keep-alive timeouts. I've been studying the haproxy manual for the timeout http-request option, timeout http-keep-alive option, and timeout server option. If I'm understanding the manual correctly, timeout http-keep-alive is the time to keep the connection open between new requests and timeout http-request is the time to wait for the response's headers before closing the connection. But what I can't seem to figure out is what timeout server dictates. I want to say that timeout server is the time to wait for the full response, but can anyone confirm that? If I'm right that timeout server is the time to wait for the full response, then am I correct that it shouldn't have any bearing on the keep-alive timeout settings?
Here's my haproxy config that I'm working on modifying:
global
maxconn 4096
pidfile /var/run/haproxy.pid
daemon
defaults
mode http
retries 3
option redispatch
maxconn 5000
timeout connect 5000
timeout client 300000
timeout server 300000
listen HTTP *:80
mode http
cookie HTTP insert nocache
balance roundrobin
#option httpclose # I just commented this out in favor of http-server-close
option http-server-close
timeout http-keep-alive 500 # from the haproxy manual suggestion of "tens to hundreds of ms"
timeout http-request 5000
option forwardfor
stats enable
stats uri /my-lb-status
stats auth myLbStatus:123456
reqadd X-Forwarded-Proto:\ http
option httpchk GET /robots.txt HTTP/1.0
server SERVER_A 1.2.3.4:80 cookie app_01 check
server maintenance 127.0.0.1:8080 backup
Ultimately my goal is to be able to turn on keep-alive between the browser and haproxy with the requirement of being able to run a report that can take 2-3 minutes to run on the app servers.