sablierapp / sablier

Start your containers on demand, shut them down automatically when there's no activity. Docker, Docker Swarm Mode and Kubernetes compatible.
https://sablierapp.dev/
GNU Affero General Public License v3.0
1.36k stars 46 forks source link

fix(providers/kubernetes): Added QPS and Burst tweaks for client-side throttling #178

Closed valexz closed 1 year ago

valexz commented 1 year ago

Hello

The reasoning behind this PR is to enable the adjustment of QPS and Burst configuration parameters in the client-go library.

This will help avoid constant throttling issues when dealing with over 100 K8S deployments. The default values are insufficient for such a large number of deployments.

How client-side throttling works: // NewTokenBucketRateLimiter creates a rate limiter which implements a token bucket approach. // The rate limiter allows bursts of up to 'burst' to exceed the QPS, while still maintaining a // smoothed qps rate of 'qps'. // The bucket is initially filled with 'burst' tokens, and refills at a rate of 'qps'. // The maximum number of tokens in the bucket is capped at 'burst'.

acouvreur commented 1 year ago

Awesome! @valexz I will change the target branch to beta

This is something I wanted to do for a long time and is a known issue (at least by me)

valexz commented 1 year ago

It is my first experience with public PR, and seems i did something wrong, when tried to make diff clearer for beta branch. Should I return all to the starting point, or i may just create a new PR based on beta branch?