I can't recall the original thread that went off on a tangent, but there
was some talk about whether or not the mysql C libs handled failover,
round-robin, etc.

I was curious myself, so I asked about this on the mysql list.  Apparently
the libs don't do anything special; if you hit a db that doesn't respond,
the connection fails and that's that.  Has anyone thought about building
in some simple "oh, this host is down, but I've got three more A records
for '' to try, so let's try the next"?

from the mysql list:

> I have a quick question about how programs linked against the mysql C
> libraries handle the following:
> -assume three mysql hosts, say,, and
> -assume a dns name "" that returns the following:
> has address
> has address
> has address
> If my client program repeatedly connects to "" and my
> nameserver round-robins through those IPs, will the client also keep
> cycling through those?  What is the behaviour if one of those hosts does
> not respond?  Will the client application then try the next one?

The MySQL C client libarary doesn't treat this case specially.

Jeremy D. Zawodny     |  Perl, Web, MySQL, Linux Magazine, Yahoo!



Reply via email to