Krishna Misra

Pipeline note
Case 04 of 04

How Redis kept transcription within 500 concurrent jobs

← All work

A shared pool of expiring slots kept independently scaling workers within one provider account’s limit.

Interactive 500-slot Redis + Lua semaphore (each cell = 10 slots)

220 of 500 slots leased · Redis healthy

Finished jobs release their slots; the TTL reclaims any a dead worker held

One account, many workers

AssemblyAI’s 500-job limit applied to the whole account. Adding an EC2 worker increased the number of processes that could submit audio, without increasing the allowance. A counter local to each process could never see the total.

Give each job an expiring slot

The workers used Redis and Lua to acquire slots from one shared pool. A worker polled the queue according to the capacity available. Once a job finished, its slot became available for the next recording.

The slot lifetime followed the queue visibility timeout. If a worker crashed, the lease could expire. A heartbeat extended visibility for long recordings, and writes keyed by recording ID made redelivery safe.

Degraded operation

If Redis became unavailable, each instance used a local limiter and raised an alert. Only the shared limiter could enforce the fleet-wide ceiling.