Skip to content

Add failover server in Image Builder #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 22, 2024
Merged

Conversation

Nickinthebox
Copy link
Member

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

🧑‍🔧

@Nickinthebox Nickinthebox merged commit 710a75c into main Sep 22, 2024
1 check passed
@Nickinthebox Nickinthebox deleted the nr-add_failover_server branch September 22, 2024 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants