scheduler simulator
queues, slots, retries and timeouts on a deterministic clock
Question
What happens to a job when slots are limited, an attempt fails, or a timeout fires? A teaching model of a job scheduler: change durations, retries, backoff and failures, then step through the queue one tick at a time. It illustrates the idea behind Orbit’s job settings; Orbit has no scheduler yet, and this page does not run it.
Bench
Three jobs, one slot. Watch the queue drain in submission order.
Reduced motion is on: run jumps straight to the end instead of playing tick by tick. Step still advances one tick.
Tick 0
Pick a scenario or edit the jobs, then step or run.
- w waiting: not submitted yet or backing off before a retry
- q queued: ready, no free slot
- R running: holds a slot
- C completed
- F failed for good
- X cancelled
What to watch
- scheduling
- Deciding which ready job gets a free slot next. Here the rule is first ready, first served; ties go to the job listed first.
- queueing
- A job that is ready but has no slot is queued (q). Queues grow when work arrives faster than slots free up.
- concurrency
- More slots shorten the total time only while there is work to share. Two slots cannot finish five jobs faster than the longest one.
- retries
- A failed attempt can be tried again, up to max retries. The first attempt is not a retry, so 2 retries allow 3 attempts.
- backoff
- Waiting before a retry (w) gives a struggling dependency room to recover. Fixed waits the same time; exponential doubles it. Real systems often add random jitter; this model has none so every run repeats exactly.
- timeouts
- A timeout stops an attempt that has not finished. An attempt as long as the timeout still succeeds; one tick longer does not. Without a timeout a hung job holds its slot until you reset.
- failure handling
- An error ends the attempt, a hang never ends by itself. Either can be retried; once retries run out the job is failed for good and the queue moves on.
Limits
- This is a teaching model with an integer clock. No real job runs, nothing is scheduled in the background and nothing is stored.
- It is not Orbit. Orbit’s Job records a maximum number of retries and an execution timeout, but its architecture notes list retries and workers as outside the initial scope, so there is no Orbit scheduler to mirror.
- Real schedulers add priorities, cron schedules, persistence, worker failure and clock drift. None are modeled here.
- The simulation stops after 120 ticks.
Fidelity
Inspired by the job settings in Orbit revision 2967494 (maximum retries and execution timeout). Orbit’s architecture notes put retries and workers outside its initial scope, so no Orbit behavior is reproduced. Time is an integer clock, nothing runs in the background, and nothing is stored.