Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can you support token bucket in next version? #48

Open
zhaowujin opened this issue Jan 15, 2021 · 5 comments
Open

Can you support token bucket in next version? #48

zhaowujin opened this issue Jan 15, 2021 · 5 comments

Comments

@zhaowujin
Copy link

Sometimes, token bucket is more suitable.

@jeepli
Copy link

jeepli commented Jun 30, 2023

I found it works as token bucket but NOT leaky bucket, I wonder if I miss understand the leaky bucket algorithm

@whongki
Copy link

whongki commented Sep 28, 2023

I found it works as token bucket but NOT leaky bucket, I wonder if I miss understand the leaky bucket algorithm

According to the code, it has burst which proves it's a token bucket where you can have burst because you didn't use all the tokens. For a leaky packet, it will slows down the coming traffic until the gate opens, it surely not the same thing.

@kevin19930919
Copy link

@whongki Thanks for the clarification! I spent the whole day wondering why it was a leaky bucket rate limiter, this tool looks more like a token bucket.

@kevin19930919
Copy link

@whongki Thanks for the clarification! I spent the whole day wondering why it was a leaky bucket rate limiter, this tool looks more like a token bucket.

hmm... After more research on my part, it seems that GRCA is not a traditional leaky bucket, but an algorithm based on time windows but belonging to the leaky bucket type
I don’t quite understand the difference between GRCA and token bucket, nor why GRCA is a leaky bucket algorithm as mention

@kevin19930919
Copy link

It seems like there are 2 version of leaky bucket

  1. as a meter
  2. as a queue

In case of took it as a meter, leaky bucket actually the same as token bucket.

 In fact both are effectively the same, i.e. implementations of both the leaky bucket and token bucket, as these are the same basic algorithm described differently.

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

No branches or pull requests

4 participants