Code RoomBatch job throughput collapse
HardPrep Room Coding #2773

Batch job throughput collapse

On-callConcurrencyDistributed systemsSenior–Staff~35 min

A nightly batch pipeline that processes a queue of jobs from a Postgres `jobs` table used to finish in 20 minutes; since you scaled the workers from 4 to 40 it now takes 3 hours and barely uses CPU. Workers claim jobs with `SELECT ... FROM jobs WHERE status='pending' ORDER BY created_at LIMIT 1 FOR UPDATE`, then update the row. With more workers, throughput went DOWN. `pg_stat_activity` shows most workers blocked on `Lock`. Triage and mitigate.

What a strong answer looks like

Stop the bleeding first (mitigate), then form hypotheses from real signals. Separate root cause from symptom, communicate status as you go, and close with what prevents a repeat.

0:00 of about 35 min
Which questions mattered is sealed until you submit. Telling you now would just be handing over the edge cases.