A shared worker pool is the simplest way to drain API requests, but a single FIFO queue can let one busy account crowd out the others. If one account adds 500 requests while three others add 10 each, those smaller batches may sit behind the burst even when their accounts have made no recent requests. A minimal alternative is one pending queue per account, a global cap of eight in-flight requests, and a cap of two per account. When a worker becomes free, pick the next eligible account in round-robin order and take its oldest request. The tradeoff is unused capacity when only one account is active. Letting that account borrow extra slots is an option, but I’d first check whether idle workers are a real problem.
Rate-limit responses should change which requests are eligible, not occupy a worker while a timer runs. If a response for one account says Retry-After: 90, record its next eligible time and return the worker to the pool; other accounts can keep moving. If the limit applies to an endpoint or the whole application instead, pause that scope rather than assuming it belongs to one account. Log the account, endpoint, time spent waiting, response status, and next eligible time. Global throughput alone can look healthy while one account consistently waits longest. How do you distribute worker slots across accounts, and what do you watch to catch unfair waits?