Skip to content

Conversation

@JoshVanL
Copy link
Collaborator

Updates the trigger function to use a callback function as the result handler, rather than the function response. This has been done to not spawn a new go routine for every job, and instead utilize a consistent worker pool. This significantly reduces the number of go routines in high-throughput scenarios, improving performance and reducing resource consumption.

Jobs are routed to a set of worker loops based on a simple hash of the job name. By default, 64 workers are created, but this can be adjusted.

Updates the trigger function to use a callback function as the result
handler, rather than the function response. This has been done to not
spawn a new go routine for every job, and instead utilize a consistent
worker pool. This significantly reduces the number of go routines in
high-throughput scenarios, improving performance and reducing
resource consumption.

Jobs are routed to a set of worker loops based on a simple hash of the
job name. By default, 64 workers are created, but this can be adjusted.

Signed-off-by: joshvanl <me@joshvanl.dev>
Copy link
Contributor

@nelson-parente nelson-parente left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

overall looks good to me though I'm not familiar with this code 🙃

JoshVanL added a commit to JoshVanL/dapr that referenced this pull request Dec 2, 2025
Workers is the number of workers that handle job events. The higher the number
the more go routines will be spawned, each working over a partition of the
total job space. The higher the number, the higher the number of jobs which
can be concurrently delivered to runtimes. Increasing this number increases
the number of go routines for this instance. This number should be tuned to
the bottleneck of job execution, i.e., CPU, I/O, memory, etc.

Defaults to 128 workers.

`--workers=N` flag for the scheduler binary.

`dapr_scheduler.workers=N` in the Helm chart.

Branched from dapr#9205

Uses diagridio/go-etcd-cron#103

Signed-off-by: joshvanl <me@joshvanl.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants