Rate limiting task queues and workers

Hi, where can I read more about the options for rate limiting?

I am interested in:

  • rate limiting at the task queue level
  • rate limiting at the worker level

My understanding is that both are possible, but I must be missing something obvious.

Thank you,
Jacques

1 Like

Just noticed that there is a property with a different name across Java and Go SDKs:

Java SDK

Use WorkerOptions properties to configure.

  • maxActivitiesPerSecond - worker specific rate limit
  • maxConcurrentActivityExecutionSize - worker specific limit on number of parallel activities
  • taskQueueActivitiesPerSecond - global task queue limit across all the workers

Go SDK

Use WorkerOptions properties to configure

  • WorkerActivitiesPerSecond - worker specific rate limit
  • MaxConcurrentActivityExecutionSize - worker specific limit on number of parallel activities
  • TaskQueueActivitiesPerSecond - global task queue limit across all the workers
2 Likes

This is exactly what I was looking for. Thank you Max!

Is the following configuration possible?

I have a worker that will run on special hardware (FPGA enabled). That worker can either do jobs of type A or B; however, it can only do one A job at a time, but it can do 10 B jobs at a time. The worker should only process jobs of one type at a time (i.e. no concurrent jobs of A and B on the same node).

How would this be configured?

With such requirements wouldn’t it lead to full starvation of job A?

A given workflow will have several tasks to accomplish, with a blend of types A and B. There will be dedicated activity queues for a single workflow, but only one worker node. I’m want to get a feel for how to run B jobs in parallel while ensuring A jobs run serially.

So there is a finite number of jobs that will ever go into the tasks queues.

If you have only one workflow execution (instance) using that worker then I would implement all the logic in the workflow itself. It has full control over which activities are scheduled and at which point.