I'm tuning a haproxy server (version 1.5-dev22). Each url manage has today a backend with only one server (previously 2), so there no longer loadbalancing. Each backend has the option "httpclose" setted up, it also in the defaults options.

I want to activate the keepalive on it, so I will delete the httpclose in the default option and backend, but i'm trying to look for the best : no httpclose at all, or http-server-close. "http-server-close" will be better for loadbalancing only ? It would better for me to only set "timeout http-keep-alive" to maintain connection from client to server ?


  • Just leave the httpclose in the defaults and that's it. It is more beneficial for load balancing and faster detection of issues. Unless the application itself can benefit from longlived sessions. – zeridon Nov 19 '15 at 9:34
  • I don't have loadbalancing, that's why I want to remove it. My haproxy just do static forwarding. url1 --> server1, url2 --> server2. – VinceCore Nov 19 '15 at 13:38

Use option http-server-close.

This causes HAProxy to keep connections alive toward the client, while closing them toward the server after each request. The client round trip time is usually long and the server round trip time usually short, making this the most appropriate choice for many applications, since server connections tend to be more costly to maintain open, while idle client connections incur very little cost inside HAProxy itself.

You typically don't want idle clients tying up server connections, and that's what this option prevents.

Also, consider updating to HAProxy 1.5.15.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.