MDCT: Multithreaded and Distributed Credit Tracking
Enforcing one aggregate rate limit across many concurrent processing units — the cores of a multi-core data plane, or the servers of a horizontally scaled fleet — is a basic building block of networking, cloud and AI infrastructure. Existing approaches serialise admission through a shared counter protected by locks or atomic instructions, route every decision through a central coordinator, or lease credit from a hierarchy of buckets. Respectively, these limit scalability, add latency and a single point of failure, or over-admit by design. We present MDCT (Multithreaded and Distributed Credit Tracking), a credit-tracking algorithm in which every processing unit admits work against its own local token bucket, and periodically refills that bucket from exact accounting state that its peers publish, rather than from estimates of their demand. Within a multi-threaded process, MDCT is lock-free, wait-free and free of atomic read-modify-write instructions, and needs no coordination: every shared word has exactly one writer, and the admission path touches only unit-local state. Across machines, MDCT needs no centralised entity, no consensus, no leader and no hierarchy of buckets; the same per-unit computation runs unchanged whether peer state arrives through shared memory or through periodic, lossy and delayed messages. We state the algorithm's invariants and its rate-safety properties with proofs or proof sketches, and derive design rules for its two tunable parameters. In long-running experiments under heavily oversubscribed, heterogeneous bursty traffic, the shared-memory implementation holds the RMS aggregate rate error to 0.53% over 43 hours across 75 processing units, and the fully distributed implementation holds it to 1.73% over 48 hours across 100 nodes with inter-node latencies of up to 250 ms and gossip message loss. In production, MDCT has sustained more than 60 Gb/s of multi-threaded traffic shaping on 8 cores with linear scaling.
Authors
- Mukul Katiyar (ORCID: https://orcid.org/0009-0000-6394-3872)
Publication Details
- Journal
- Zenodo (CERN European Organization for Nuclear Research)
- Published
- 2026-11-30
- DOI
- https://doi.org/10.5281/zenodo.24672598
- Primary Topic
- Network Traffic and Congestion Control
- Type
- preprint