In nearly every trading setup, the first latency chart shows one number: time from order submission to acknowledgement. It is easy to collect and hard to diagnose. That interval can include a client network, a broker gateway, risk checks, internal queues, a venue connection and the venue's own processing. A slow acknowledgement does not tell you which one caused the delay.
For an engineering team, the useful question is not whether a route is fast. It is where time is spent, how the distribution changes under load, and whether the measured event is the one the desk cares about. A fill, a venue acknowledgement and a broker response are different events.
The route is a chain, not a single timer
Start and stop at explicit events
Define the measurement before comparing routes. A client-side interval might run from the moment an API request is ready to send to the moment the client receives an acknowledgement.
A broker-side interval could run from the gateway's first byte received to its first byte sent in response. A venue interval might run from the broker's outbound send to receipt of the venue acknowledgement.
Those intervals overlap only if their event boundaries are designed to do so. Keep separate timestamps for:
- Client request creation, socket write and response receipt.
- Broker ingress, validation complete, risk decision and outbound send.
- Venue acknowledgement, execution report and client notification.
Do not label the full client-to-ack interval "execution time". It includes transport in both directions and may include time spent waiting for a response to be serialised or forwarded. Execution reports can arrive after an order acknowledgement, while a marketable order can fill before the client sees that acknowledgement.
Separate clocks from elapsed time
Use a monotonic clock for durations measured within one process. Wall-clock timestamps are useful for correlating events across systems, but clock skew can make a short stage appear negative or longer than it was. Synchronise hosts with PTP where the infrastructure supports it, monitor offset, and record the clock source and estimated error alongside telemetry.
For a single request, calculate stage durations from local monotonic timestamps wherever possible. Cross-host subtraction is less reliable unless you know the hosts' relative offset. If a gateway reports 200 microseconds of processing but its clock is 800 microseconds behind the risk service, the apparent stage breakdown is fiction. This is a basic measurement concern covered in wider trading infrastructure engineering coverage.
Where latency accumulates
Broker-side work
Parsing, symbol and account lookups, entitlement checks, credit controls and order validation all sit between ingress and route selection. In a well-instrumented in-memory path, individual checks often take fractions of a millisecond to a few milliseconds. The bigger risk is a synchronous dependency: a remote cache miss, database call, lock contention or serialised risk service can turn a short path into a variable one.
Measure both service time and queue wait. A risk service can report a 0.4 ms handler duration while requests wait 12 ms in its input queue. Likewise, a gateway can have low CPU use and still build delay behind a single FIX session, a congested event loop or a downstream connection with limited capacity.
Network and venue path
Transport time depends on physical distance, network design and the connection type. Co-location can reduce the network component substantially, but does not remove gateway work, venue queues or exchange processing.
A broker routing through a regional data centre may add several milliseconds compared with a direct cross-connect. Public internet access can add tens of milliseconds and greater variance, particularly for users far from the broker's edge.
The table gives typical market ranges for planning and investigation, not service guarantees. Actual results vary by venue, geography, protocol, order type and load. Treat each row as a separate interval, not a set of numbers to add blindly.
| Route segment | Typical market range | What the interval includes |
|---|---|---|
| Client to broker edge, one way | 5-30 ms; 30-150 ms at p99 for many internet paths | Access network, geographic distance and edge ingress |
| Gateway parsing and validation | 0.1-2 ms | Protocol decode, basic checks and in-process routing work |
| Risk and account checks | 0.2-5 ms; 2-10 ms or more with synchronous dependencies | Limits, credit, permissions and service calls |
| Internal queue wait | Below 1 ms when uncongested; 5-50 ms during contention | Waiting for workers, sessions or downstream capacity |
| Broker to venue and acknowledgement return | 0.1-2 ms co-located; 2-20 ms regionally; 10-80 ms over wider internet routes | Network round trip plus venue response and broker handling |
These ranges mix one-way and round-trip intervals, as stated in the first column. Do not compare them without matching boundaries. For example, a broker-to-venue round trip cannot be compared directly with a one-way client-to-edge measurement.
Measure distributions by route
Use percentiles, not just averages. A mean of 4 ms can hide a route that is usually 1 ms and occasionally 80 ms. Track p50, p95, p99 and, where traffic volume supports it, p99.9. Include counts and the time window. A p99 based on a few hundred orders is a weak basis for a capacity decision.
Segment the data so a busy instrument or session does not disappear inside an aggregate. Useful dimensions include:
- Venue, account group, symbol, order type and route decision.
- Protocol session, gateway instance, region and network path.
- Market state, order rate, message rate and risk-service dependency status.
Track rejects, timeouts, retransmissions and cancel or replace paths alongside new-order latency. Averages can improve while operational outcomes worsen if slow requests time out and vanish from the completed-order sample. Record dropped and unfinished requests, and define whether your latency figure ends at the first acknowledgement or at the final execution report.
For a practical dashboard, show ingress-to-egress broker processing, queue wait, outbound-to-venue acknowledgement and client round trip as separate series. Add a request or correlation identifier that survives each service hop. Sampling can reduce storage, but keep unsampled event counts and retain full traces for a controlled diagnostic window. A short capture during a p99 incident is often more useful than months of aggregates without stage detail.
Change one component, then verify
Before tuning, establish a baseline during normal activity and at a representative peak. Compare matching routes and market conditions. Then change one element, such as gateway worker count, risk-service placement, session capacity or network path, and check both the latency distribution and the failure rate.
Common interventions have trade-offs:
- More workers can reduce queue wait but increase contention, context switching and downstream concurrency.
- Batching can improve throughput while adding wait for orders that arrive at the start of a batch.
- Local caches can avoid network calls but introduce invalidation and stale-limit risks.
- Extra validation can add measurable time, but removing a control may create unacceptable exposure.
Replay tests help isolate software changes, but a replay that lacks production queue depth, venue response variance and network behaviour will understate tail latency. Combine load tests with production telemetry, and set alert thresholds on both percentiles and sustained breach duration. A single slow order may be expected; a rising p99 across a route cohort is a capacity or dependency signal.
Record the version, configuration, traffic mix and clock health for every comparison. That makes a latency change interpretable during a release review or incident, rather than a chart with no operational context. The mistake most readers will still make is treating one end-to-end average as the latency of the route.
Frequently Asked Questions
How should a broker measure order routing latency?
Timestamp explicit events at client, gateway, risk service and venue boundaries. Use monotonic clocks for within-process durations, correlate events across services, and report percentiles with request counts.
Which latency percentile matters most for order routing?
Track p50, p95 and p99 to show typical and tail behaviour. Use p99.9 only when the route has enough volume to make that estimate meaningful, and review timeouts and incomplete requests separately.
What causes high order routing latency at a broker?
Common causes include network distance, internal queueing, synchronous risk or data-service calls, FIX session contention and downstream venue delay. Stage-level timings help distinguish these from one another.
Platforms · Software · Providers · Markets