Effect Weighted Load Balancer
Load balancing that notices a degraded backend instead of feeding it its rotation share. Round-robin routes a fixed slice to a server whose in-flight queue is climbing (GC pause, cold cache); the power-of-two-choices strategy samples two random backends and picks the one with fewer in-flight requests, near-optimal balance with two counter reads and no global scan or herd. Each backend's in-flight count is a Ref bracketed by Effect.ensuring so a failed or interrupted request still decrements, and the demo shows a 12x-slower backend shedding to a third of its round-robin load. Pinned to effect 4.0.0-beta.98.
npx shadcn@latest add @compronents/effect-weighted-load-balancerInstalls from ui.aryank.space. Needs a registry token and a one-time @compronents entry in components.json. The docs walk through both.
Round-robin hands the degraded backend its full rotation share. b3 is 12x slower, yet its in-flight queue climbs to 12 and stays there while a third of traffic waits behind it.