Interview Lab
When can the next request start?
Two inference servers each start with ten active requests and nine waiting. Nine active requests finish at four seconds. The last finishes at ten seconds. Assume there is enough memory to admit waiting requests as slots free up.
When can the first waiting request start under static batching and under continuous batching? Explain why the start times differ.
Animated solution
Worked solution
The first waiting request starts at 10 seconds with static batching and at 4 seconds with continuous batching.
- At 4 seconds, nine requests finish. The continuous scheduler can immediately refill the nine free slots. The static scheduler keeps the batch open for the one request still running.
- At 10 seconds, the last original request finishes. The static scheduler can now start the next batch. The waiting requests on the continuous scheduler already started six seconds earlier.
A belt slot represents capacity for one active sequence. Picking up a bag means generation finished. Loading a bag means the scheduler admitted a waiting request. The example assumes negligible admission overhead. Real schedulers also check token and KV-cache budgets.