1 realtime admission throttling and load shedding
forgejo-actions edited this page 2026-07-11 12:38:13 +00:00

Realtime Admission, Throttling, And Load Shedding

Realtime admission decides whether a handoff can become a pending realtime session. It combines capacity, zone pressure, endpoint health, drain state, Redis-backed abuse prevention, local fairness throttles, and short-lived admission reservations.

Purpose

Use this runbook when a client receives server full, zone full, zone overloaded, gameplay endpoint unavailable, or repeated rate-limit failures during handshake or realtime hello.

Admission Snapshot And Rejection Reasons

The game server builds an AdmissionSnapshot from drain state, active and reserved session counts, per-zone counts, endpoint availability, and tick health. Shared evaluator code maps the snapshot to rejection reasons in priority order. The game server records admission decisions as metrics.

Expected rejection families include draining, server full, zone full, zone overloaded, endpoint unavailable, and zone unavailable on this instance.

Reservation Lifecycle

Handshake reserves admission before doing work that would otherwise race capacity. The reservation occupies capacity even before the pending session exists. Success commits the reservation into the pending session. Any later handshake failure must roll it back.

Expired reservations are pruned by the session store. If admission appears full with no pending sessions, inspect expired reservation pruning and handshake paths that may not have rolled back.

Abuse Prevention Throttles

Abuse prevention protects handshake, failed token attempts, and realtime hello. IP and session scopes can use shared Redis counters so multiple game-server processes see the same abuse window. If Redis is unavailable, local fallback behavior should still reject obvious bursts.

These throttles happen before or around admission. They are not the same as per-packet fairness throttles after activation.

Fairness Throttles

Fairness throttles apply to active clients and packet families such as chat, movement datagrams, gameplay state, equipment state, trigger authority, gameplay actions, and snapshot repair requests. They are descriptor-aligned with realtime ingress metadata.

Fairness throttles usually produce packet-validation/rate-limit decisions rather than admission rejections.

Configuration And Env Overrides

Networking policy controls maximum players, per-zone capacity, endpoint health rejection, tick overrun thresholds, and throttle windows. Add new policy knobs through config/env docs so operators can discover them from the same place as other service settings.

Metrics And Debugging

Check admission decision counters, networking throttle decisions, tick health, active and pending sessions, endpoint health, and zone allocation records. If only one zone rejects, inspect zone pressure and tick health for that zone. If all handshakes reject, inspect drain state, global capacity, Redis throttle state, and QUIC endpoint health.