Hi Baptiste.

Baptiste have written on Wed, 24 May 2017 11:34:31 +0200:

> 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.

Wow great work.

I have take a look into the code and have just some questions about
calloc in [PATCH 03/11] & [PATCH 07/11]

In the function dns_alloc_resolution is calloc used, would the use of
haproxy pools bring any benefit?

[PATCH 08/11]
+static int dns_cache_size = 1024;       /* arbitrary DNS cache size */

For the future maybe there could be a glolbal.tune.dns-cache-size or
something similar.

Do I have understand the code right that you have per resolver a cache
and this resolver belongs to a backend/frontend.

So in case several backends have the same server names all resolver
requests this server individual.
There is no 'global dns cache' for all or I missed something.


> Please give it a try and report any issues you may spot :)
> 
> Baptiste

Regards
Aleks

Reply via email to