haproxy, stud and proxy protocol

From: Vincent Bernat <bernat#luffy.cx>
Date: Tue, 11 Oct 2011 10:39:48 +0200


I have run some bench with stud + haproxy (1.5-dev7) and found that stud with "--write-proxy" parameter adds 40 ms of latency. stunnel has recently added (4.45) PROXY support too and enabling it does not add any latency. Therefore, I think the problem does not lie in HAProxy but maybe there is some bad interaction. I have modified stud to do a strcpy of a static proxy line:

               strcpy(ring_pnt, "PROXY TCP4 56732 443\r\n");

               written = 43;

Still, 40 ms of latency. I have also modified stud to not send the proxy line until there is something else to send (by commenting out "ev_io_start" in "if (OPTIONS.WRITE_PROXY_LINE)" section of handle_connect(). No change. Since the code handling PROXY protocol is so small in stud, I have no other idea of what to do. See here for the relevant code:

Any idea where the latency could lie?

You can find some graph here:

I also attach a direct comparison with and without "--write-proxy".

Received on 2011/10/11 10:39

This archive was generated by hypermail 2.2.0 : 2011/10/11 10:45 CEST