bumptech/stud — Issue #42: Latency of 40ms when using `--write-proxy`
Author: vincentbernat
Created: 2011-10-11 20:16:59+00:00
State: open

Hi!

I have run some bench with stud and I always get a latency around 40ms with `--write-proxy`. This latency disappears if this option is not present. This latency does not exist in stunnel 4.45 which features a similar functionality. I have tried to replace snprintf with strcpy (and a constant string) without any change.

I mean, with something like this, there is still the same latency:

```
if (OPTIONS.WRITE_PROXY_LINE) {
char *ring_pnt = ringbuffer_write_ptr(&ps->ring_down);
strcpy(ring_pnt, "PROXY TCP4 1.1.1.1 2.2.2.2 5555 443\r\n");
written = 37;
ringbuffer_write_append(&ps->ring_down, written);
ev_io_start(loop, &ps->ev_w_down);
}
```

Also removing `ev_io_start` does not help. Any idea?

On the other hand, there is haproxy 1.5-dev7. More details on the setup here: http://vincent.bernat.im/en/blog/2011-ssl-benchmark-round2.html