Skip to content

Make k8s client rate limiter parameters configurable#3833

Closed
tfujiwar wants to merge 1 commit intoactions:masterfrom
mercari:tfujiwar-k8s-client-rate-limiter
Closed

Make k8s client rate limiter parameters configurable#3833
tfujiwar wants to merge 1 commit intoactions:masterfrom
mercari:tfujiwar-k8s-client-rate-limiter

Conversation

@tfujiwar
Copy link
Contributor

@tfujiwar tfujiwar commented Dec 2, 2024

WHAT

Make k8s client rate limiter parameters configurable.

WHY

To reduce latency of runner pod creation (#3276).

EphemeralRunnerReconciler requires several k8s API calls until pod creation and those API calls are rate limited by a client library. It would be helpful if users can optimize the rate limiter parameter on their responsibility.

TESTING

We have tested the change with QPS=80 and Burst=120 (4 times higher than the default) while running 50-100 runners and confirmed that the reconcile time of EphemeralRunnerReconciler has decreased from 60 ms to 20 ms.

Screenshot 2024-12-02 at 21 43 19

@tfujiwar tfujiwar requested review from a team, mumoshu, rentziass and toast-gear as code owners December 2, 2024 12:56
Comment on lines +151 to +152
flag.IntVar(&k8sClientRateLimiterQPS, "k8s-client-rate-limiter-qps", 20, "The QPS value of the K8s client rate limiter.")
flag.IntVar(&k8sClientRateLimiterBurst, "k8s-client-rate-limiter-burst", 30, "The burst value of the K8s client rate limiter.")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Link-
Copy link
Member

Link- commented Dec 13, 2024

Thank you @tfujiwar - I had to move this change to another branch so that I can run all the workflows and validate the change.

You will still be the author of the change and the commit will remain attributed to you.

#3848

@Link- Link- closed this Dec 13, 2024
@pulkitanz
Copy link

This has sped up my reconciles a fair bit, thank you for adding this!! :)

@azrsh azrsh deleted the tfujiwar-k8s-client-rate-limiter branch October 21, 2025 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

attention Requires attention

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants