Skip to content

Global RPS Control for Admin Batch Operation#10546

Merged
yycptt merged 3 commits into
temporalio:mainfrom
yycptt:admin-batch-global-rps
Jun 5, 2026
Merged

Global RPS Control for Admin Batch Operation#10546
yycptt merged 3 commits into
temporalio:mainfrom
yycptt:admin-batch-global-rps

Conversation

@yycptt
Copy link
Copy Markdown
Member

@yycptt yycptt commented Jun 5, 2026

What changed?

  • Add host level rate limiter for controlling RPS of admin batch operations across all namespaces and all admin batch workflows.

Why?

  • When running admin batch operations we only care about controlling the total RPS, not really RPS for a given namespace or a given admin batch workflow.

How did you test it?

  • built
  • run locally and tested manually
  • covered by existing tests
  • added new unit test(s)
  • added new functional test(s)

Comment thread service/worker/batcher/fx.go Outdated
) fxResult {
adminBatcherHostRateFn := calculator.NewLoggedCalculator(
calculator.ClusterAwareQuotaCalculator{
MemberCounter: serviceResolver,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

shouldn't this pay attention to the per-ns worker count? you can get the number from the workercommon.RegistrationDetails passed to Register, and this worker's share is Multiplicity / TotalWorkers

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

hmm not really? this is limit across all namespaces and all admin batch jobs.

Copy link
Copy Markdown
Member Author

@yycptt yycptt Jun 5, 2026

Choose a reason for hiding this comment

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

actually I will check if I can just use the distributed rate limit here.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

oh I see, I misunderstood the scope

)

var Module = fx.Options(
fx.Provide(AdminBatcherRateLimiterProvider),
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This allows us to inject a different implementation in cloud.

)

type (
AdminBatcherRateLimiter quotas.RequestRateLimiter
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Our internal implementation only implements RequestRateLimiter interface, not RateLimiter.

@yycptt yycptt marked this pull request as ready for review June 5, 2026 09:33
@yycptt yycptt requested review from a team as code owners June 5, 2026 09:33
Comment thread common/dynamicconfig/constants.go Outdated
Comment thread common/dynamicconfig/constants.go Outdated
@yycptt yycptt merged commit 6e424ea into temporalio:main Jun 5, 2026
49 checks passed
@yycptt yycptt deleted the admin-batch-global-rps branch June 5, 2026 19:48
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.

4 participants