Hi all,
Over the last few weeks, I entirely reworked the internal resolver of
HAProxy to make it more flexible.
The main driver for this is to add more features related to DNS use-cases
(SRV records, scale in / scale out a backend, DNS converter, etc...) and
also to make it more efficient internaly and more friendly with DNS servers
;)
With this in mind, I performed the following changes:
- DNS tasks are now autonomous, they are not triggered by the health check
any more, this means we can enable DNS resolution without enabling health
monitoring on a server
- DNS responses are now kept in memory, when they are not an error... so
many servers using the same hostname resolution will use a response in the
cache if it is fresh enough
- full "anonymisation" of the requesters. Up to now, DNS code was though
for servers only (well layers were pretty well defined). I added an
abstraction layer between the resolution and the requester, so the
requester could be of any HAProxy internal type (backend, bind, ...).
- management of requester through queues: 2 queues are available: the run
queue and the wait queue. If a requester needs a resolution, he will
register himself to the run queue, and if he is the first one, then the
resolution is triggered
- a pool of resolution is now linked to a resolvers section. Memory is
allocated at configuration parsing time. If the pool is too small for your
configuration, an error is returned.
I still have a few minor things to work on, but since HAProxy Tech guys
needs my code to move forward on their contribution, I'm publishing it
right now.
Please give it a try and report any issues you may spot :)
Baptiste
Over the last few weeks, I entirely reworked the internal resolver of
HAProxy to make it more flexible.
The main driver for this is to add more features related to DNS use-cases
(SRV records, scale in / scale out a backend, DNS converter, etc...) and
also to make it more efficient internaly and more friendly with DNS servers
;)
With this in mind, I performed the following changes:
- DNS tasks are now autonomous, they are not triggered by the health check
any more, this means we can enable DNS resolution without enabling health
monitoring on a server
- DNS responses are now kept in memory, when they are not an error... so
many servers using the same hostname resolution will use a response in the
cache if it is fresh enough
- full "anonymisation" of the requesters. Up to now, DNS code was though
for servers only (well layers were pretty well defined). I added an
abstraction layer between the resolution and the requester, so the
requester could be of any HAProxy internal type (backend, bind, ...).
- management of requester through queues: 2 queues are available: the run
queue and the wait queue. If a requester needs a resolution, he will
register himself to the run queue, and if he is the first one, then the
resolution is triggered
- a pool of resolution is now linked to a resolvers section. Memory is
allocated at configuration parsing time. If the pool is too small for your
configuration, an error is returned.
I still have a few minor things to work on, but since HAProxy Tech guys
needs my code to move forward on their contribution, I'm publishing it
right now.
Please give it a try and report any issues you may spot :)
Baptiste