Add failover server in Image Builder #9
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Current behavior
We use
img.mapado.net
subdomain to load images.This address is a "random" DNS pointing between several servers to distribute the load.
However, if one of the servers crashes (which happened recently), we randomly have images that don't work while a devops adjust the setting and... waiting the cache to be refreshed (there is a 2-hour cache on resolution on this subdomain !). This might be a breaking issue on high load, as when an image doesn't work, it may crash generation of PDFs.
New behavior
I'm adding an option to use a new subdomain,
failover-img.mapado.net
, to use when you have a "critical" need for an image.This time, this address is not a "random DNS" between the two servers, but an address "monitored" by a third party.
This subdomain will point by default to a single server (hosted at OVH, the closest to our main production servers).
When it detects that the main server is down, in this case it will switch the DNS pointing to another server (hosted at Scaleway, our recovery platform) with a short time DNS cache delay.
It is not meant to be used in basic "front" needs (img.mapado.net is still the main subdomain to be used), because it is expensive in machine resources (instead of distributing the load, it concentrate it on one server) and in DNS calls (because of the low DNS cache delay). We use it by default in the twig extension, as this is mainly (only?) used in our PDF generation process.
Clickup Task
🧑🔧