Fairness algorithm design: DRR vs WFQ/SFQ, aging, and high-cardinality keys #5
cognis-digital
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
safequeue's
schedulerpackage implements Deficit Round Robin (DRR) (Shreedhar & Varghese, 1996) for per-tenant fairness: each key has a FIFO backlog and a weight, and the round-robin ring grantsquantum × weightcredit per visit, carrying leftover deficit forward for backlogged keys and resetting it when a key goes idle (so an idle key can't hoard credit and burst on return). This gives weighted, work-conserving fairness with no starvation — seedocs/ARCHITECTURE.md.I'd like to open the design up before we build the next layer. Some questions:
1. Is DRR the right primitive, or should we offer alternatives?
2. Aging / priority interaction.
Today priority (in the durable core) and fairness (in the scheduler) are separate layers. Should fairness be priority-aware (fair within a priority band), or should they stay orthogonal? A concrete use case: a low-weight tenant with an urgent high-priority item.
3. Dynamic weights.
SetWeightis available but weights are static per call. Is there demand for feedback-driven weights (e.g. shrink a tenant's weight as it exceeds a quota)?4. Fairness key cardinality.
DRR keeps one backlog per active key. For millions of ephemeral keys this is unbounded memory. Options: cap active keys + spill, SFQ-style hashing, or document it as the caller's responsibility. Preferences?
Interested in real workloads: how many distinct fairness keys do you expect, and what's your tolerance for delay vs strict throughput fairness?
All reactions