Multiple rate limits for Oban queues

I am using Oban Pro with a queue with the following config:

my_queue: [rate_limit: [allowed: 100, period: {1, :seconds}]]

What I would like is to have multiple rate-limits, e.g. 100 per seconds and 1000 per hour. Is it possible to configure that?

No, it’s only possible to have a single rate limit configured for a given queue. Can you share more about your use case? There may be another way of controlling insertion/execution that would work.

I have some API access with the above rate limit requirements, and we forward every requests we make through Oban Jobs to respect the limits.

One way I could do is to have two queues, one with the 100/s rate limit and the other with 1000/h limit, then let the first job just queue a second job when it is execute. Though it’s a bit too much overhead.

1 Like