Routing

Cross-site site selection

How a grid gateway serving gridServing chooses a site for each request in grid_site_route, what feeds the choice, and what you can change.

Praxis Grid v0.2.0 4 min read

Switching projects opens that project’s default documentation release.

On this page

How a grid gateway serving gridServing chooses a site for each request in grid_site_route, what feeds the choice, and what you can change. The routing overlay and the consumer intelligent_route filter are a separate path, described in routing.md.

Site choice

Each site’s operator scrapes its EPP and relays its series, per provider. The gateway polls every site, concludes what each holds, learns each site’s ceiling as the most it has held with nothing waiting, and reads saturation (rho) as in-flight over that ceiling. A site has room while rho is below 1. Among healthy sites with room, three or more are picked two by ceiling taking the lower rho, two are picked between weighted by ceiling over 1 + rho, one is taken. With no site that has room, the pick is by ceiling among the sites not full, tied on the best queue depth. A site that is not ready, or whose cluster praxis reports with no healthy endpoint, is chosen only when no healthy site is left.

With availability.shedding on, a model sheds once every healthy site serving it has been at its ceiling with work waiting for full_after_ms, and routes again once no sample from a site has shown that for room_after_ms. A shed request gets 429 with Retry-After. A model with no healthy routable site gets 503.

Inputs

InputSeriesSource
Running per endpointllm_d_epp_average_running_requestsThe EPP, relayed as is.
Waiting per endpointllm_d_epp_average_queue_size, inference_pool_per_pod_queue_sizeThe EPP, relayed as is.
Held before schedulingllm_d_epp_flow_control_queue_sizeThe EPP, relayed as is.
Ready endpointsllm_d_epp_ready_endpointsThe EPP, relayed as is. Zero reads as not ready.

The gateway concludes in-flight as running plus waiting per endpoint, times ready endpoints, plus what flow control holds. The operator’s grid_provider_* series are its own conclusions for Prometheus and dashboards; the gateway reads none of them.

Every input comes from the EPP’s /metrics. Point metricsConfig.metricsEndpoint at the EPP Service, since a pod address can reach a standby replica that reports nothing. The gateway keeps no count of its own requests.

Settings

Nothing needs setting. availability.shedding is the one switch, off by default. The other fields of the filter’s availability block, set from the chart’s gridServing.siteRoute.availability, have defaults, and their table and tuning order are in routing.md. On the operator, GRID_SIGNALS_SCRAPE_INTERVAL_SECS (default 5) sets how often it scrapes its EPP, and metricsConfig.staleMetricsSeconds how long a failing scrape keeps the last readiness.

What to watch

grid_route_site_ceiling, grid_route_site_rho and grid_route_site_weight per site and cluster; grid_route_selections_total{path} for which arm each request took; grid_route_decisions_total{site,reason} for what was routed and what was refused and why; grid_route_shedding{model} while a model is shed. Every routed response names its site and cluster in x-grid-site and x-grid-backend.

Symptoms

SymptomLikely causeAction
A site is never chosenZero ready endpoints, or its cluster has no healthy endpointCheck llm_d_epp_ready_endpoints and the gateway’s cluster health log line
A site’s ceiling sits far below what its engine runsIt was queued whenever it ran high, so no sample taughtRaise explore_floor
A small or slow site takes littleExpected: picks follow measured ceilings, and two choices never pick the busiest of threeNothing
429 under light loadShedding is on and full_after_ms or queue_full is too low for the engine’s normal queueRaise them, or turn shedding off
A site answers errors fast and takes the most trafficA refusing site never fills, so it reads as the site with the most roomFix the site; passive ejection is a planned gate