We have a multi-tenant app that runs resque
for background processing.
The issue we occasionally run into is when a single tenant performs a lot of background work within a very short period of time. This essentially clogs up the queue for a while -- every other tenant's jobs are delayed while we work through the backlog for this single tenant.
Yes, we can add more workers. But that's not really a "solution", it's more a band-aid that still results in a delay for other tenants -- just a shorter delay as we process faster.
Is there more multi-tenant friendly way to use resque
? Or a more multi-tenant friendly background queue entirely?
We've looking at either:
- using a queue per tenant, and a worker per tenant (dynamically created queues?)
- modifying
resque
so that it somehow round-robins through a queue per tenant
We're just wondering if there's something we're missing / a better way...