Managing Long Running Tasks hard
In a Priority Queue system (High vs Low), what is 'Starvation' and how do you fix it?
- A The workers get hungry.
- B Low priority tasks never run because new High priority tasks keep arriving. Fix: 'Aging' (gradually upgrading priority of old low tasks) or Dedicated Capacity (20% of workers only work Low queue).
- C The queue gets full.
- D High priority tasks are slow.
Answer: B. Low priority tasks never run because new High priority tasks keep arriving. Fix: 'Aging' (gradually upgrading priority of old low tasks) or Dedicated Capacity (20% of workers only work Low queue).
Strict priority scheduling is dangerous for low-class citizens.
One system design question a day, with spaced repetition so the ones you miss come back.
Get the appRelated questions
- What is the primary purpose of a Dead Letter Queue (DLQ)?
- The architectural pattern where one service creates tasks and another processes them is called:
- How do you atomically update your local database AND publish a message to a queue without losing sync if the process crashes in between?
- What does 'Fire and Forget' mean?
- Why might you 'Throttle' (limit the speed of) your background workers?
- When implementing retries for failed tasks, why use 'Exponential Backoff' with 'Jitter'?