Blog & guides
How NanoFlags measures flag propagation in public
The method behind the live propagation numbers on /speed and /status: a probe that publishes a real change every 5 minutes, listeners on Cloudflare's network, how a sample is defined, and what the number does not tell you.
NanoFlags engineeringPublished 4 min read
On this page
The NanoFlags site shows a propagation time in the header, on the home page and on /speed. That number is not a benchmark we ran once. It is recomputed every minute from samples a probe collects all day, and the slow samples count as much as the fast ones. This post explains how the samples are made, so you can judge the number yourself.
- p50
- 279 ms
- p95
- 424 ms
- samples
- 1,407
- probe locations
- 6
- KIX · p50 243 ms · p95 373 ms · n=282
- MEL · p50 248 ms · p95 384 ms · n=281
- LHR · p50 289 ms · p95 423 ms · n=281
- DEN · p50 303 ms · p95 446 ms · n=282
- ATL · p50 312 ms · p95 414 ms · n=147
- IAD · p50 333 ms · p95 462 ms · n=134
Last 24 hours, all probe locations. Newest sample 2026-11-19 23:10 UTC. Per-location tables on /status
What one sample measures
A sample is the time from the database commit timestamp of a published revision to the moment a listener receives the signed bundle of that revision over a live WebSocket connection to the edge. That is the path a connected SDK takes: the publish transaction pushes the new revision to the publisher, the publisher signs it with Ed25519 and hands it to one Durable Object per environment, and that object sends the signed bundle down every open socket. The SDK applies it without a second request.
The probe
The probe is a separate Cloudflare Worker that only touches a dedicated probe environment, never a customer environment. Every 5 minutes it does what the dashboard does when someone publishes:
- Signs in as the probe user and edits the draft of one flag (
probe-tick). - Calls
publish_environment, the same database function the dashboard calls, and hands the new revision to the publisher, as the dashboard's direct push does. - Reads the revision's commit timestamp (
revisions.published_at) from the database. - Waits 15 seconds, asks every listener what it received, and records one sample per listener with
probe_record.
Listeners are Durable Objects placed with Cloudflare location hints. Each keeps one outbound WebSocket to wss://edge.nanoflags.io/v1/live with a server key of the probe environment, and takes the arrival time first thing in its message handler. Today the probe runs listeners in five hints: western and eastern North America, western Europe, Asia-Pacific and Oceania. The location shown next to each number is the Cloudflare data center where the listener actually ran, as reported by the runtime. A hint names a region, not a data center, so over a day you can see more locations than hints.
Clocks and the commit timestamp
Two details make the number slightly pessimistic or slightly noisy, and we would rather tell you than hide them:
- Postgres takes
now()at the start of the publishing transaction, a little before the commit. Every sample therefore includes the time the publish transaction itself takes. - The commit time comes from the database server's clock and the arrival time from the Cloudflare Workers clock. Both are synchronised independently, so an offset of a few milliseconds between them is part of every sample.
Samples are validated before they are stored. A negative value means the clocks disagree and is dropped; anything above 60 seconds is treated as a fault, not a measurement:
// workers/probe/src/samples.ts (simplified)
const ms = Math.round(receivedAt - committedAt);
if (ms < 0) dropped.negative++; // the two clocks disagree
else if (ms > 60_000) dropped.tooLate++; // something else went wrong
else samples.push({ region, transport: "live", ms, revision });A listener that does not receive the revision within 15 seconds produces no sample. The probe counts those misses separately, and the operational monitor alerts on them, but they are not part of the percentiles. If they were, a single dropped socket would read as a 15-second propagation time, which is a different failure from a slow one.
From samples to p50 and p95
The public database function latency_summary(p_hours) aggregates the stored samples with linear-interpolated percentiles, overall and per probe location. The status page, the speed page, the header pill and the widget above all read the same function for the last 24 hours. The site caches the answer for 60 seconds. When a fetch fails it keeps showing the last good answer, marked as stale with its timestamp; if nothing was ever loaded, it shows no number at all rather than a made-up one.
What the number does not tell you
- Your network, your devices and browsers, and the last mile to your application.
- SDK processing after the bundle is received (verification and the atomic swap).
- The fallback transports. When a WebSocket cannot open, the SDK uses server-sent events plus a conditional fetch, and polling as a safety net. Those paths are slower and are not measured here.
- Revisions that did not arrive within 15 seconds, and samples rejected as invalid (see above).
It is measured propagation, not a guarantee and not a service level.
Measure it in your own process
You do not have to trust our probe. The JavaScript SDK reports the same quantity for every revision pushed to your process: latencyMs on the update event is the time from the database commit to that event. Like the probe, it compares two clocks (the database's and yours), so it is only as accurate as they agree.
import { createClient } from "@nanoflags/sdk";
const flags = createClient({ sdkKey: process.env.NANOFLAGS_SDK_KEY!, baseUrl: "https://edge.nanoflags.io", service: "checkout-api" });
flags.on("update", (e) => {
// latencyMs: database commit → this event, only for pushed revisions that carry a commit time.
if (e.latencyMs !== null) console.log(`r${e.revision} via ${e.transport} in ${e.latencyMs} ms`);
});The raw per-location tables are on /status, and the delivery path is described on /speed. Questions about the method are welcome at support@nanoflags.io.
- propagation
- methodology
- edge
- websocket