Add PollerScalingInfo to poll requests by veeral-patel · Pull Request #887 · temporalio/api · GitHub
Skip to content

Add PollerScalingInfo to poll requests - #887

Open
veeral-patel wants to merge 2 commits into
mainfrom
vpatel/poller-load-balancing
Open

veeral-patel wants to merge 2 commits into
mainfrom
vpatel/poller-load-balancing

Conversation

@veeral-patel

Copy link
Copy Markdown

What

Adds PollerScalingInfo to temporal.api.taskqueue.v1, carrying a single field, and attaches it as field 11 on both PollWorkflowTaskQueueRequest and PollActivityTaskQueueRequest.

message PollerScalingInfo {
    int32 poller_target = 1;
}

Why

Poller scaling suggestions ride on dispatched tasks, and the matcher hands tasks to waiting pollers in FIFO order. So a worker's share of suggestions tracks its share of pollers: growth is proportional to current size, in both directions. The equilibrium is degenerate — any imbalance between otherwise identical workers is preserved and amplified rather than corrected.

Measured on three identically configured workers, the activity poller split landed at 74/12/14 percent, with a different winner each run.

Fixing that needs the server to know how each worker's pool compares to the fleet, and the poller target is the one number that makes the comparison possible. 0 means unknown (for example a fixed-size pool), and the server applies no share-based fairness to such a worker — so SDKs that never populate this are unaffected.

Notes

  • Field 11 on both requests; 7 is reserved, 8–10 are taken.
  • Deliberately not slot capacity. An earlier revision also reported max_slots to weight share by execution capacity; it was dropped to keep the wire contract to one number.

Stacked on this

  • temporalio/sdk-go — reports the target on each poll
  • temporalio/temporal — consumes it to spread suggestions across the fleet

Workers report the poller target of the pool issuing each poll so the server
can distribute poller-scaling suggestions fairly across a fleet.

Scaling suggestions ride on dispatched tasks and the matcher is FIFO, so a
worker's share of suggestions tracks its share of pollers. Growth is therefore
proportional to current size, which preserves any imbalance between otherwise
identical workers rather than correcting it. With a reported target the server
can withhold suggestions that would push a worker further from its share.
Comment on lines +39 to +44

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I dunno that this needs to go into detail about the specific motivating problem. Can probably just drop the whole paragraph honestly.

Comment thread temporal/api/taskqueue/v1/message.proto Outdated
Co-authored-by: Spencer Judge <spencer@temporal.io>
@veeral-patel
veeral-patel marked this pull request as ready for review October 20, 2026 20:11
@veeral-patel
veeral-patel requested review from a team October 20, 2026 20:11
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