Benchmarking and placement: colocation, same-AZ discovery, and proving where to run

You cannot buy a cross-connect in the cloud, so you discover placement: launch many hosts, measure each one's tail to the venue, keep the best few and destroy the rest — then re-run it, because placement decays.

Read the briefing
About 3 min to read 6 drills

What to remember

  1. Two identical instances are not identical. Different hypervisor, rack, NIC generation and neighbours. That variance is what makes selection work.
  2. Select on the tail, not the median. A host with a good median and a fat p99.9 is the one that hurts you during the open.
  3. Write the decision rule before the data arrives. Otherwise you are selecting on noise and calling it a result.
  4. Placement decays — schedule the benchmark. Providers change hardware, venues move endpoints, neighbours arrive. A one-off measurement becomes folklore in a quarter.
  5. Colo buys determinism; cloud buys elasticity. Mix on purpose. The latency-critical path goes where the physics is fixed; everything else goes where the provisioning is fast.

The big picture

Placement is an experiment, not a purchase. This topic covers how to design that experiment so its answer is real, how the same-AZ discovery pattern works and why it is cheap, what colocation buys that cloud cannot, and how to keep the answer from going stale.

The mental model

Latency to a venue is mostly distance and queueing you cannot see. Since you cannot inspect the topology, you sample it: many hosts, the same measurement, keep the best tails. It is A/B testing applied to physics.

In depth

Designing the experiment

Fix everything except the thing you are measuring: the same instance type, image, kernel, tuning and workload, driven against the same venue endpoint at the same time of day. Take enough samples per host to compare distributions rather than medians, and write the decision rule first — for example "keep hosts whose p99.9 is within 10% of the best observed, discard the rest". Without a pre-registered rule you will select the tail of a noise distribution and then defend it.

Run the measurement from the host itself against a real endpoint (a venue's session or a market-data feed), not against a synthetic echo, because the path you care about includes their gateway.

Same-AZ discovery

In a cloud region, a venue's matching engine sits somewhere you cannot see, and the difference between "same availability zone, same spine" and "one hop further" is real and unbuyable. The pattern that works is brute force: launch tens or hundreds of instances across zones, measure each one's latency and jitter to the endpoint, keep the small percentage with the best tails as production hosts, terminate the rest. It is cheap because instances are billed by the second and the measurement is automatable, and it is repeatable because the whole thing is a job rather than a project.

Two operational notes. Keep the survivors pinned — do not let an autoscaler replace a hand-picked host with a random one — and record the placement metadata you can see (zone, placement group, host id where exposed) so the next run starts informed.

Colocation and the honest comparison

Colocation gives you known cable lengths, cross-connects to the venue, dedicated hardware, no hypervisor and no neighbours — the determinism the cloud cannot sell. It costs lead time measured in weeks, capital, remote hands, and an operational surface (hardware failure, firmware, spares) that the cloud absorbs for you.

The comparison that survives scrutiny is not "colo is faster" but: for this path, at this percentile, colo is X microseconds better and Y dollars a month more, and the desk's edge is or is not worth that. Most organisations end up mixed — colo or bare metal for the latency-critical leg, cloud for research, backtesting, monitoring and the parts where elasticity is worth more than microseconds.

Keeping it true

Placement decays for reasons outside your control: the provider refreshes hardware, the venue moves or adds endpoints, a neighbour arrives on your host, a new instance family appears. So the benchmark becomes a scheduled job with a dashboard and an alert on regression, and the survivor set is reviewed after any instance-family, region or venue change. The artefact that matters is not the current best host but the pipeline that can find next quarter's.

Myths and facts

Myth: Same availability zone means same latency.

Fact: A zone is a large facility (often several). Hosts within one zone differ measurably, which is the entire basis of discovery.

Myth: Pick the host with the best median.

Fact: Select on the tail. A good median with a fat p99.9 fails exactly when volume spikes.

Myth: Once you have found good hosts you are done.

Fact: Hardware refreshes, endpoint moves and new neighbours all move the answer; the benchmark is a scheduled job.

Myth: Colocation is always faster, so always use it.

Fact: It is more deterministic and usually faster on the critical leg, at a cost in lead time, capital and operational surface. State the trade in microseconds and dollars.

How pros do it

  • Fix every variable but placement; drive the real endpoint; pre-register the decision rule.
  • Select on tail percentiles with enough samples per host, and record the environment fingerprint.
  • Automate launch → measure → keep → terminate so the experiment is repeatable rather than heroic.
  • Pin survivors out of autoscaling, and re-run after any instance family, region or venue change.
  • Compare colo and cloud in microseconds and dollars for the specific path, not in principle.

Questions people ask

Colo or cloud?

Colo for the latency-critical leg, cloud for everything else — and say it in numbers: for this path, at this percentile, colo is X microseconds better and Y dollars a month more. Colo fixes the physics (cable length, a cross-connect, no hypervisor, no neighbours) where cloud can only be sampled for it. The caveat is lead time and an operational surface — spares, firmware, remote hands — that the cloud absorbs for you.

What do I measure against?

The venue's real endpoint over the real protocol where their limits allow it, otherwise their published test endpoint in the same facility. The path you care about includes their gateway, so a synthetic echo in your own VPC measures your VPC. Same time of day, too — the path at the open is not the path at lunch.

How many instances is enough?

Enough to see the spread: tens per zone to start, and you will usually find a clear best decile. Instances are billed by the second and the measurement is a job, so the cost is minutes of instance time. The mistake is sampling three and calling the best one placement.

How often should the job run?

Weekly for a live desk, plus on demand after any change to instance family, region, image or venue endpoint. Placement is relative to someone else's endpoint and hardware, so it decays with nothing changing on your side. Trigger on change and schedule modestly rather than running it daily.

Can I use placement groups instead?

No. Cluster placement groups reduce latency between your own hosts; they say nothing about distance to someone else's gateway. Use them for intra-fleet paths and keep discovery for the venue path.

Does this apply outside trading?

Yes: RPC nodes to peers, validators to their gossip network, and any latency-sensitive path to a third party you do not control. The mechanism is the same — variance you cannot request, so you sample it.

Further reading

Drills · 6

Answer in your head, or out loud, before you reveal. Mark each one: "Again" brings it back, "Got it" counts on your desk.

1 Pick the strongest answer

Why does launching a hundred instances and keeping the best few actually get you closer to a venue in the same cloud region?

  1. Newly launched instances are always faster until they age. Instances do not slow with age; placement is the variable.
  2. Hosts within a zone differ by rack, spine, NIC generation and neighbours, so the distribution of latency across instances is wide — sampling it and keeping the best tail is buying placement you cannot request. The technique exploits real, unrequestable variance inside a zone.
  3. It does not work; latency within a region is uniform. Measurably untrue, which is why desks do this.
  4. It works because the provider prioritises recently created instances. No such prioritisation exists.
In short

Hosts in the same zone differ in rack, hardware and neighbours, so measuring many and keeping the best tails buys placement you cannot request.

Why

An availability zone is one or more large facilities. Two instances of the same type can sit different numbers of hops from a venue's gateway, on different hardware generations, with different neighbours. That spread is the resource you are mining.

Read the docs

2 Read the output

Here are last night's results. Which hosts do you keep for the order-entry path, and which row do you not trust?

host        n        p50(µs)  p99(µs)  p99.9(µs)  max(µs)
i-0a1  120000       78        96        104        260
i-0b2  118500       74       182       1180       9400
i-0c3  121000       79       101       112        280
i-0d4    2100       61        88        —          130
i-0e5  119800      140       165       181        410
  1. Keep i-0a1 and i-0c3: good p99.9 and tight ratios. Distrust i-0d4 — only 2,100 samples, so it has no p99.9 at all and its numbers are not comparable. i-0b2 is fast at the median and catastrophic in the tail; i-0e5 is consistently slower. Tail plus sample count is the selection basis; a small-n host is unranked, not best.
  2. Keep i-0d4 — it has the best p50 and the lowest max. 2,100 samples cannot support a tail claim; it also ran a different amount of time, so conditions differ.
  3. Keep i-0b2 because its p50 is second best. A p99.9 of 1.18 ms on an order path is disqualifying.
  4. Keep all except i-0e5, since the rest are within 2× on p99. i-0b2's tail is more than 10× the best; a 2× p99 threshold hides that.
In short

Keep i-0a1 and i-0c3, and distrust i-0d4 because 2,100 samples cannot show a tail.

Why

Read the table as distributions with confidence attached. The p99.9/p50 ratio is the quickest jitter proxy: about 1.3 for the keepers, 16 for i-0b2. And a host with two per cent of the samples has not been measured, it has been sampled.

Read the docs

3 Pick the strongest answer

A colleague runs the discovery job and keeps the three hosts with the single fastest observation. What do you tell them?

  1. Three hosts is too few to run production on. Possibly, but the statistic is the flaw being tested here.
  2. They should have used the mean. Better than a minimum, still the wrong statistic for a tail-sensitive path.
  3. Nothing — the fastest observation is the best proxy for potential. It measures the luckiest packet, not the host.
  4. A minimum is the noisiest statistic available and says nothing about behaviour under load; select on a tail percentile from enough samples, against a rule written before the data arrived. Selection must use a stable statistic that reflects the failure mode you care about.
In short

A single fastest sample is noise; pick hosts by a tail percentile from many samples, using a rule written before the test.

Why

Selection on a minimum guarantees you pick the host with the most favourable noise. p99 or p99.9 from tens of thousands of samples, with a pre-registered threshold, is what makes the survivors meaningfully better rather than luckier.

The common mistake

Switching to the mean. Better than the minimum, still the wrong statistic for a path that hurts in the tail.

Read the docs

4 Scenario: what do you do next?

Latency to one venue degraded 30% at the p99 across your whole selected fleet, overnight, with no change on your side. The other two venues are unaffected.

Step 1. First step?

  1. Establish whether it is your path or theirs: compare against a control host outside the selected set, check the venue's status and any endpoint change notice, and look at whether p50 moved with p99 or only the tail. Fleet-wide, single-venue degradation points at the path or the venue, not at any one host.
  2. Re-run the discovery job immediately and replace the fleet. Expensive and premature: if the venue moved its endpoint, new hosts will be equally affected.
  3. Escalate to the provider. Possible next step, but you have no evidence to hand them yet.
  4. Start tuning kernels on the affected hosts. Nothing local changed, and the other venues are fine from the same hosts.

Step 2. The venue moved its gateway to a new endpoint in a different zone last night. What now?

  1. Accept the 30% and move on. On a latency-sensitive path that is a competitive loss you can fix in a day.
  2. Migrate immediately, in the session. Unproven hosts during market hours is exactly the risk the freeze exists for.
  3. Ask the venue to move it back. Not a lever you have.
  4. Re-run discovery against the new endpoint, migrate to the new survivors during a window outside the session, and keep the old hosts until the new ones are proven in production. Placement is relative to the endpoint; a moved endpoint invalidates the selection, and a staged migration keeps the desk trading.

Step 3. Prevention?

  1. Subscribe to venue change notices and treat an endpoint change as an automatic discovery trigger; keep a control host outside the selected set so path changes are visible immediately; alert on per-venue percentile regression. Turns an external change into a detected trigger with a rehearsed response.
  2. Run discovery daily for every venue. Wasteful; trigger on change and schedule modestly.
  3. Document that latency can change. Not a mechanism.
In short

First find out whether the venue or the path changed, using a control host and the venue's notices; then re-run discovery against the new endpoint.

Why

Placement is relative to someone else's endpoint, which means their change is your regression. The interview signal is the control host, the trigger on venue notices, and staging the migration around market hours.

Read the docs

5 Quick recall

When you rank hosts from a placement benchmark for a latency-sensitive path, what statistic do you rank on?

In short

A tail percentile such as p99 or p99.9.

Accepted

a tail percentile · p99.9 · p99

Why

A tail percentile (p99 or p99.9) from enough samples, not the median or the minimum — the tail is what hurts during a volume spike.

6 Design round

Design the placement programme for a desk trading three venues: two in a cloud region, one reachable only from a colocation facility. Cover the discovery pipeline, the selection rule, the colo/cloud split, and how the answer stays current.

  • Two infrastructure engineers; the desk trades during market hours and will not tolerate experiments in the session.
  • Finance wants the monthly cost of the programme, not just of the hosts.
In short

A strong answer makes discovery a scheduled job with a rule written in advance, pins the winners, re-runs after any change, and prices the whole programme.

A strong answer covers
  • Discovery pipeline: automated launch across zones, identical image and tuning, real endpoint measurement, histogram capture, terminate the rest.
  • Selection rule pre-registered: tail percentile threshold plus a jitter ratio, with a minimum sample count.
  • Survivors pinned out of autoscaling, recorded with placement metadata and environment fingerprint.
  • Colo for the venue that requires it, with cross-connects, spares and remote hands; cloud for the other two plus research.
  • Schedule: weekly re-run out of hours, plus triggered runs on instance-family, region, image or endpoint change.
  • Monitoring: per-host latency percentiles in production with regression alerts, not just at selection time.
  • Costs stated: instance-hours for discovery, standing colo and cross-connect, engineer time.
  • Explicit statement of what would change the split (edge no longer worth the colo cost, venue moves, provider hardware refresh).
What a strong answer does
  • design quality: Full pipeline with pre-registered rule, pinning, scheduled re-runs, production regression monitoring, and a reasoned colo/cloud split.
  • rigour: Tail percentile plus jitter ratio plus minimum sample count, distributions merged not averaged, environment recorded.
  • operations: Fits two engineers: everything is a scheduled job, survivors are pinned, and the programme survives someone being on holiday.
  • economics: Discovery instance-hours, colo standing cost, cross-connects, engineer time, and the condition under which the split changes.
Why

Staff answers turn placement into a pipeline with a pre-registered rule and a decay plan, and price the programme rather than only the hosts.

Read the docs

Next lesson Jitter and the tail: measuring p99.9, finding the interference, and not lying to yourself with averages
Drill · Benchmarking and placement
0:00

Loading…