cURL / Mailing Lists / curl-library / Single Mail

curl-library

DNS Failover

From: leonardo.bolanos <leonardo.bolanos_at_nekotec.com.mx>
Date: Tue, 21 Nov 2006 18:58:44 -0500

Hi All

We have set-up a DNS failover solution with two PCs, a DNS windows
server and a small application that dynamically changes
the DNS records in case one of the PCs fails or shuts down. When
testing, we send data to an Apache http server in one of the PCs and
then remove it's network access, within 6 seconds the application has
changed the DNS records so the direction that the sender was using is
now pointing to the other PC. The problem is that it takes a lot of time
for libcurl to realize (or acknowledge) the change in the ip address...

We've toyed with the configuration adding parameters like
"DNS_CACHE_TIMEOUT" and "FRESH_CONNECT", but it still takes it near a
minute to switch
addresses... going into the code, we've found that the variable
"dns->inuse" was always increasing its value (never decreasing it) and
that was
causing that the dns prune was never called...

We would like to know what recommendations do you have for our issue,
and where would be the best moment to call the "curl_resolv_unlock"
function when
there's a connection failed error.

Best regards.

-- 
Hector Leonardo Bolaņos Muņoz
Developer Engineer
Received on 2006-11-22