Hi Richard, On Wed, Aug 21, 2019 at 09:40:55AM +0100, Richard Mason wrote: > Hi HAProxiers, > > I'm using HAProxy 1.8 on Centos, and I was wondering if it is possible to > configure the tune* parameters by front end? > > Specifically, we have a large number of connections, and need to set: > > tune.sndbuf.client 2048000 > > We have a few hundred ports to proxy, but not all require such a large > sendbuffer, and the difference is a meaningful quantity of memory. Ideally > it would only be set on a portion of our proxied ports.
I can easily understand, and thought about it when doing it, but preferred to keep the config simple until the need arises. The proper way to do it is by adding a set of new "bind" keywords (the keywords you have on the "bind" lines), so that they are applied to incoming connections, let's call them "rcvbuf" and "sndbuf" which are pretty explicit for this line. It's not particularly hard to do if you're interested in looking at it, just check how "mss" is handled (it sets a maxseg value on the listeners). The keyword is registered in proto_tcp.c. In session.c, where rcvbuf and sndbuf are checked and applied, you'd just have to first check if a value is set on your listener (as is done just above for maxseg), and apply it, otherwise fall back to the global settings. Just give it a try, and please update the doc :-) Cheers, Willy

