Request Pacing Valve

Requests wait as balls in a bucket. A valve lets them out one at a time into a pipe that takes 0.5 s to pass through. The pipe clogs if it holds more than 10 balls, which is the server's limit of 10 requests per 0.5 s. A camera watches the pipe, and a controller sets the valve from what the camera sees.

While fewer balls than the burst size are in the pipe, the valve is fully open (the burst). The burst size is the burst ratio times 10, rounded down. Otherwise the controller sets the valve so the pipe fills up exactly as the ball that limits it leaves. The valve never closes while balls wait, it only narrows. Retries go back into the bucket and wait in line like any other ball.

The controller keeps a valve setting until the ball that set it has left the pipe, a ball comes later than the setting allows, or a burst happens. Only then does it calculate a new one. For comparison, the page also shows the calculation done anew for every ball, which gives the same release times.

0.000 s

The contraption

In the bucket: 0 In the pipe: 0 / 10 Released: 0 Retries so far: 0 Calculations, per segment: 0 per ball: 0
Burst (valve fully open) Valve narrowed after a burst Steady or as the balls arrive Retry Ball that sets the valve

Releases over time

Top row: when each ball is let out. Middle row: stretches with one fixed valve setting. Bottom row: when balls arrive in the bucket, including retries.

Controller reading