> First would be resolution of SRV records and actually using the port > supplied by the SRV record as the port for the server. I looked at the code > and it doesn't seem like too much work, most of it would probably be > changing the config stuff accordingly.
You're right, this could be an interesting option. Actually, we though about the SRV records to populate a full backend server list with IP, name, port, weight using a single DNS query. > The other one is... well you asked for it ;) so here it goes: it would be > great to express in the config something like "resolve this name and use up > to X servers from the reply". The backend then allocates X servers. > Assuming that the initial lookup returns Y results, the (sorted) records > get assinged to the first Y servers, the other X-Y servers get marked as > down. Upon a new lookup, same procedure for a potentially changing value of Y. > I realize this a pretty bold feature request for several reasons, but I > have actually spent some thought on it think it might be doable without > really violating any of HAProxy's design paradigms. I would also be willing > to invest some time (code) into this myself. > If you think this might be at least worth a discussion, I'd be happy to > share some more detailed thoughts and it would be great to hear your > thoughts on that, too. First, there are some limitations about creating servers on the fly in a backend. So instead, we propose you to pre-allocate servers by configuration and then wait for the DNS to populate it. I don't speak about a request per server, I speak here about one request for the whole farm :) You go one step further than the design we have about SRV records to populate the backend. We thought using priority to decide whether a server is active or backup. The advantage is that you don't need to reload HAProxy to change your X value ;) I would welcome a contribution about SRV record type. That said, before this, I have to rewrite part of the response parser to store the response in a real DNS packet structure instead of keeping data in a buffer. Baptiste