Skip to content

Add weighted fair scheduling for vqueues via scope rules#5013

Open
PascalThesing wants to merge 1 commit into
restatedev:mainfrom
PascalThesing:feature/two-level-wrr-scheduler
Open

Add weighted fair scheduling for vqueues via scope rules#5013
PascalThesing wants to merge 1 commit into
restatedev:mainfrom
PascalThesing:feature/two-level-wrr-scheduler

Conversation

@PascalThesing

Copy link
Copy Markdown

Problem

With experimental-enable-vqueues, dispatch capacity is proportional to a
service's queued key count: a service with 100K queued keys starves few-keyed
services (measured: ~50 batching keys at 0.05% dispatch share).

Changes

  1. Two-level WRR: the eligibility ring and the invoker-concurrency waiter
    list rotate over scheduling groups (invocation scope, else service name);
    weight N = N slots per cycle regardless of key count. Per-queue DRR inside
    a group unchanged; service groups fixed at weight 1.
  2. Weights as rules: restate rules set <scope> --weight N
    (UserLimits.scheduling_weight, shown in rules list / sys_rules).
    With experimental-enable-scope-inheritance, ctx.call children inherit
    the caller's scope — one rule governs the whole call chain.

Validation

115 tests (exact weighted ratios, work conservation, wire compatibility);
benchmark: one weight-10 rule → +52% throughput for the flooding service
while the starved batchers flush twice as often.

@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@PascalThesing

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant