Skip to content

fix: load balancer admits through its pool instead of passing everything - #56

Merged
xevrion merged 1 commit into
xevrion:mainfrom
nawazish2:fix/lb-pool-admission
Sep 6, 2026
Merged

fix: load balancer admits through its pool instead of passing everything#56
xevrion merged 1 commit into
xevrion:mainfrom
nawazish2:fix/lb-pool-admission

Conversation

@nawazish2

Copy link
Copy Markdown
Contributor

What this changes

An lb now takes the engine's default serve path, so capacity, instances and queueLimit go through ordinary slot and queue discipline. Closes #52.

Why

onAdmit returned passthru, which left admission before either check ran. A balancer sized for two concurrent calls carried ~3000 rps, waiting stayed 0, and an autoscaler writing instances moved a number that bound nothing.

The inspector already said the pool was real. The engine now matches that.

Verification

client(3000 rps) -> lb -> service(64 slots x 8), lb serviceMs: 5, 30 simulated seconds. Ceiling is capacity * instances * (1000 / serviceMs).

Before (passthru):

instances  capacity  queueLimit   ceiling   throughput   in flight   queued   shed
        1         2           4     400 rps     2965.6          10        0      0
        1         2        4096     400 rps     2965.6          10        0      0
       12         2           4    4800 rps     2965.6          10        0      0
        1        64           4   12800 rps     2965.6          10        0      0

After (serve):

instances  capacity  queueLimit   ceiling   throughput   in flight   queued   shed
        1         2           4     400 rps      400.0           2        4   2660
        1         2        4096     400 rps      400.0           2     4096   2660
       12         2           4    4800 rps     2963.3          14        0      0
        1        64           4   12800 rps     2953.3          13        0      0

This changes behaviour for every design with an lb in it. Default lb sizing (256 slots at 0.5ms) still sits at ~512k rps, so existing presets stay under 2% errors.

  • bun run test — 914/914 tests pass
  • bun run typecheck and bun run lint pass
  • bun run build passes
  • Screenshot attached, if anything visual changed — n/a, engine-only

Made with Cursor

passthru skipped capacity, instances and queueLimit, so an lb had no ceiling.

Co-authored-by: Cursor <cursoragent@cursor.com>
@nawazish2
nawazish2 requested a review from xevrion as a code owner September 5, 2026 18:22
@vercel

vercel Bot commented Sep 5, 2026

Copy link
Copy Markdown

@nawazish2 is attempting to deploy a commit to the whoarrryou's projects Team on Vercel.

A member of the Team first needs to authorize it.

@xevrion

xevrion commented Sep 6, 2026

Copy link
Copy Markdown
Owner

Checked all five lb presets, none of them move. LGTM, thanks!

@xevrion
xevrion merged commit 79254ce into xevrion:main Sep 6, 2026
6 of 7 checks passed
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.

A load balancer has no ceiling: capacity, instances and queueLimit are all inert on it

2 participants