The Journey to the Holy Grail, Part 6: The Holy Grail
Moves took 25 minutes because the Hub only looked once a minute. We made it look every five seconds, broke a check that had been relying on the slowness, fixed that too, and failed every site over to Holy Grail in 35 minutes.
Watcher
4 min read
Part 6 of The Journey to the Holy Grail (opens in a new tab). Previously: The Late-Night Tickets (opens in a new tab).
By midnight on Saturday, every site was on Camelot (opens in a new tab). Holy Grail, the same pair of servers in Oregon, built from the same golden images (opens in a new tab), sat waiting. The plan was to fail every site over to it, so that Holy Grail serves and Camelot becomes the standby.
Before we did that, Charles asked the question every client would ask: why is this taking so long?
Why a move took 25 minutes
It wasn't DNS. Cloudflare switches an address in seconds, and the site answered on the very first try after each switch. It was us.
The Hub advanced a move once a minute. Every step that ran something on a server took at least two of those minutes: one to send the command and one to read the result. Even a step that finished in two seconds waited for the clock. Alpha's move took 26 minutes, ten of them with the site down, for maybe eight minutes of real work.
The fix was mostly about paying attention more often:
- Moves now advance every five seconds instead of every sixty.
- A run sheet starts its next step within seconds of the last one finishing.
- The second copy of a site's uploads, made while the site is quiet, is skipped when nothing has changed since the first.
What the speed-up broke
The first attempt at the failover (CHG-170) failed three times, on the same line each time:
its health page answered HTTP 502 Bad Gateway
The check that a site answers after its switch allowed five tries. At a minute apart, that had been five generous minutes. At five seconds apart, it was 25 seconds. And a Vexorus copy that has just restarted against its moved database answers 502 for about two minutes while it warms up.
The old slowness had been hiding that all along. Speeding up revealed it.
So the health check, the login check and the site check now each wait up to three minutes from their first miss. They ask every round, and fail only when the three minutes are up. A copy that reports "degraded" with HTTP 200 counts as answering: a warm copy runs no background worker until its cutover, and it's honest about it.
A failover in 35 minutes
Release .253 went live at 04:15 UTC on Sunday, and the failover resumed:
| Site | Moved (UTC) | Took | Down |
|---|---|---|---|
| Canary (ours) | 04:15 → 04:22 | 7 min | ~4 min |
| Tiny Tim's Palace (test) | 04:22 → 04:31 | 9 min | ~4 min |
| The Alpha Power Wash | 04:31 → 04:41 | ~10 min | ~4 min |
| The Buckeye Belle Signings | 04:41 → 04:50 | ~9 min | ~4 min |
The first two restarted copies answered 502 for about two minutes each, and the new wait rode straight through it. Every site got its own certificate on the new server. Every database went from Postgres 18 to Postgres 18. Every login answered 200. At 04:50 the run sheet reported success, and Camelot quietly became the standby.
Full circle
Here's the part that still makes us smile.
This whole journey started on one small box in OVH's Hillsboro, Oregon region. Hillsboro's quota pushed us out to Virginia, to a hand-built pair, and then to Camelot. And Holy Grail, the pool every client site now runs on, sits in Hillsboro, Oregon: right back where we started.
Same region. Very different place. Now there are two pools in two regions, golden images on both, Ubuntu 26.04, Python 3.14 and Postgres 18 underneath, and a move that takes one signature and about eight minutes. The run sheet that did it is written up in our knowledge base, so the next one starts from what worked rather than from memory.
Square zero
We didn't get here by planning it all right. We got here by writing down every way it went wrong, fixing each one in the code, and doing it again: fifteen failed or withdrawn orders, a dozen golden builds, eight accidental servers and one very long Sunday.
That's why we call this square zero. Not the end of the work, but the first time the foundation stands on its own.
Next comes the boring part we're most excited about: every machine on the latest of everything, sign-ups open to new businesses, and, if we've done our jobs, nothing to fail over from for a long while.
Read the whole series on one page: The Journey to the Holy Grail (opens in a new tab), or start again from Part 1, Square Zero (opens in a new tab).
Cloud
More like this
Cloud
Build a Tiny JSON API With Axum: Rust on the Web in Fifteen Minutes
Your Rust programs have been talking to the terminal. Time they talked to the internet. Build a notes API with Axum, with routes, JSON in and out, shared state and proper 404s, in about 50 lines.
Cloud
Ollama Review: Running Local LLMs on Your Own Machine, No Cloud Required
What if your AI assistant lived in your basement instead of someone else's data centre? A review of Ollama: how to run local LLMs with it, what hardware you really need, the API that makes it useful, and where it falls short.
Cloud
Async Rust With Tokio: Build an Echo Server That Juggles a Thousand Clients
One waiter, forty tables, and nobody waits for their soup. That's async. Learn async Rust with Tokio by building a 30-line TCP echo server, then meet the one mistake that freezes the whole restaurant.