Design Heterogeneous Compute Workload Allocation
Design a curve-aware allocator that sends interactive and batch work to two machine types while protecting latency, throughput, and retry invariants.
Problem statement
For this exercise, assume a fixed compute fleet runs two workload classes. Interactive requests are indivisible after admission and have a strict tail-latency objective. Batch jobs can be split into independently idempotent chunks and have a completion deadline.
Benchmarking produced the following representative per-worker curve points. At 50%, 70%, and 85% utilization, Machine A serves 900, 1,200, and 1,400 interactive requests per second at 10, 18, and 45 milliseconds p99, and delivers 6,000, 8,000, and 8,500 batch work units per second.
At the same utilization points, Machine B serves 650, 900, and 1,050 interactive requests per second at 16, 32, and 80 milliseconds p99, and delivers 15,000, 20,000, and 23,000 batch work units per second. Both types degrade unpredictably above 85%. The available fleet has 12 Machine A workers and 8 Machine B workers.
Steady demand is 7,000 interactive requests per second with a 25-millisecond p99 target plus batch arrivals totaling 100,000 work units per second with a ten-minute completion target.
Design how the system compares the curves, admits work, selects a machine type, assigns and tracks execution, and reallocates retryable work. Observed performance can drift by 20% from the stored profile.
Keep hardware procurement, application-specific computation, and the benchmark harness implementation outside the first version.
What to build
- A client can submit interactive work or a divisible batch job with its work estimate, latency objective or deadline, and stable request identity.
- The allocator can compare versioned performance profiles and current capacity to admit work and select a machine type with explicit headroom.
- The system can track assignments and outcomes, avoid speculative duplication of accepted interactive work, and safely retry uncommitted idempotent batch chunks.
- Operators can inspect allocation decisions and update or roll back benchmark profiles when observed throughput or latency drifts.
At scale
- For this exercise, assume the per-worker benchmark curves in the prompt are valid at publication time and both machine types have an unsafe or unpredictable operating region above 85% utilization.
- For this exercise, assume 12 Machine A and 8 Machine B workers serve 7,000 steady interactive requests per second under a 25-millisecond p99 target while batch arrivals contribute 100,000 work units per second under a ten-minute deadline.
- For this exercise, assume traffic can burst to 1.5 times steady demand for five minutes and one worker of either type may fail without warning; admission decisions should reserve defensible headroom rather than depend on fleet-wide averages.
- For this exercise, assume measured capacity or latency can drift by 20% from a stored curve and a reviewed profile change should influence new allocations within five minutes without repeatedly moving work between pools.