lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On 16 Oct 2009, at 9:07 PM, Fernando P. García wrote:

OK, mixing both solutions will work also, I mean:

A IP SRV1
A IP SRV2
A IP subdomain-SRV2

As mentioned by Michal, 'DNS round-robin' records (multiple 'A' records) are entirely undesirable for providing redundancy to websites; their purpose is for load-balancing only (distributing traffic amongst multiple [hopefully identical] copies of a site), and any other use will have unpredictable results. Indeed the load balancing is random, thus if the two servers are out of sync, a visitor might see an old page and a new page randomly in the same session. (Every browser/resolver behaves differently.)

Multiple A records may however be desirable for a subdomain used only by automated means (i.e. for CVS/LuaRocks downloads) as the lengthy/ broken resolution process during downtime might not be so unexpected by a user, or would be hidden from them. *But only providing both sites have live replication.*

By far the best approach is to simply change the A record when and if the primary web site goes down; this can be done manually at the point of the outage --or better-- by using a DNS service provider with an automatic 'fail-over' function (where they regularly ping the server, and change the IP over if it does not respond). A low-ish TTL (time-to- live zone expiry record) is needed. The downtime for new visitors is nil after it has been updated, and for visitors immediately preceding the outage it is the TTL + a web browser's cache expiry (~15mins) or OS cache expiry (when using LuaRocks etc.).

(BTW using 'SRV' as variable is slightly confusing for DNS as there is a SRV record type, which also happens to be a means of providing redundancy, albeit not for HTTP.)

HTH.