cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Multi interface and DNS load balancing

From: Seppo Heikkilä <seppo.heikkila_at_gmail.com>
Date: Thu, 11 Dec 2014 19:14:00 +0100

>> DNS load balancing is quite common so this should work quite easily.
> It isn't easy. getaddrinfo() returns the addresses in a prio order and we
go
> through the addresses in that order. How are you suggesting we change this
> without overriding the users' /etc/gai.conf, RFC 3484 and whatever more
that
> need to be taken into account? Of course, involving c-ares complicates
matters
> slightly more too... I'm open for suggestions and patches on how to
improve this.

True, does not look that easy. Thanks for the explanation! My example had
also one bug with share handles. The code should have sharehandles[i] and
not sharehandles[0]. Thus assigning separate share handles seems to still
work also at least with c-ares.

Probably I keep my current solution, which is to resolve the hostname at
the beginning and assign IPs manually using CURLOPT_RESOLVE. So basically
having my own DNS cache layer in the end. An updated multi-app.c
demonstrating this approach is attached for those who might be interested.

Cheers,
Seppo
<http://daniel.haxx.se>

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html

Received on 2014-12-11