Thanks Baptiste. My configuration file is very basic: global maxconn 100 defaults mode http option http-keep-alive option splice-response option clitcpka option srvtcpka option tcp-smart-accept option tcp-smart-connect timeout connect 60s timeout client 1800s timeout server 1800s timeout http-request 1800s timeout http-keep-alive 1800s frontend private-frontend maxconn 100 mode http bind IP1:80 default_backend private-backend backend private-backend http-reuse always server IP2 IP2:80 maxconn 10
As described by you, I did the following tests: 1. Telnet to the HAProxy IP, and then run each of the following tests: A. Serial: Run wget, sleep 0.5; wget, sleep 0.5; (8 times). tcpdump shows that when each wget finishes, client closes the connection and haproxy does RST to the single backend. Next wget opens a new connection to haproxy, and in turn to the server upon request. B. Run 8 wgets in parallel. Each opens a new connection to get a 128 byte file. Again, 8 separate connections are opened to the backend server. C. Run "wget -i <file-containing 5 files>". wget uses keepalive to not close the connection. Here, wget opens only 1 connection to haproxy, and haproxy opens 1 connection to the backend, over which wget transfers the 5 files one after the other. Behavior is identical to 1.5.12 (same config file, except without the reuse directive). D. Run 5 "wget -i <file-containing 5 files>" in parallel. 5 connections are opened by the 5 wgets, and 5 connections are opened by haproxy to the single server, finally all are closed by RST's. I also modified step#1 above, to do a telnet, followed by a GET in telnet to actually open a server connection, and then run the other tests. I still don't see re-using connection having effect. Is this test scenario different from what you had suggested? Thanks once again. Regards, - Krishna Kumar On Tue, Nov 10, 2015 at 6:19 PM, Baptiste <bed...@gmail.com> wrote: > On Tue, Nov 10, 2015 at 11:44 AM, Krishna Kumar (Engineering) > <krishna...@flipkart.com> wrote: >> Dear all, >> >> I am comparing 1.6.1 with 1.5.12. Following are the relevant snippets from >> the >> configuration file: >> >> global >> maxconn 100 >> defaults >> option http-keep-alive >> option clitcpka >> option srvtcpka >> frontend private-frontend >> maxconn 100 >> mode http >> bind IP1:80 >> default_backend private-backend >> backend private-backend >> http-reuse always (only in the 1.6.1 configuration) >> server IP2 IP2:80 maxconn 10 >> >> Client runs a single command to retrieve file of 128 bytes: >> ab -k -n 20 -c 12 http://<IP1>/128 >> >> Tcpdump shows that 12 connections were established to the frontend, 10 >> connections >> were then made to the server, and after the 10 were serviced once (GET), two >> new >> connections were opened to the server and serviced once (GET), finally >> 8 requests >> were done on the first set of server connections. Finally all 12 >> connections were >> closed together. There is no difference in #packets between 1.5.12 and >> 1.6.1 or the >> sequence of packets. >> >> How do I actually re-use idle connections? Do I need to run ab's in >> parallel with >> some delay, etc, to see old connections being reused? I also ran separately >> the >> following script to get file of 4K, to introduce parallel connections >> with delay's, etc: >> >> for i in {1..20} >> do >> ab -k -n 100 -c 50 http://10.34.73.174/4K & >> sleep 0.4 >> done >> wait >> >> But the total# packets for 1.5.12 and 1.6.1 were similar (no drops in >> tcpdump, >> no Connection drop in client, with 24.6K packets for 1.5.12 and 24.8K packets >> for 1.6.1). Could someone please let me know what I should change in the >> configuration or the client to see the effect of http-reuse? >> >> Thanks, >> - Krishna Kumar >> > > > Hi Krishna, > > Actually, your timeouts are also very important as well. > I would also enable "option prefer-last-server", furthermore if you > have many servers in the farm. > > Now, to test the reuse, simply try opening a session using telnet, and > fake a keepalive session. > then do a few wget and confirm all the traffic uses the session > previously established. > > Baptiste