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

Burst never used. #46

Open
KeinPfusch opened this issue Jun 16, 2020 · 2 comments
Open

Burst never used. #46

KeinPfusch opened this issue Jun 16, 2020 · 2 comments
Assignees

Comments

@KeinPfusch
Copy link

Seems Burst is never used.I used it with burst, but no effect.

So I went into the code, and I can't find the implementation. Is there something I am missing?

@magikstm
Copy link

magikstm commented Jun 16, 2020

Could you please describe the issue a bit more or share your caddyfile?

Burst seems to be implemented in the current build:

Ref:

Burst int

[]string{"127.0.0.1", "get", "", "/"}, Rule{Methods: "", Status: "", Rate: 2, Burst: 2, Unit: "second"}, 2, 0, false, true,

Demos:
https://github.com/xuqingfeng/caddy-rate-limit/blob/master/test_site/minute/index.html
https://github.com/xuqingfeng/caddy-rate-limit/blob/master/test_site/file/config.txt

@KeinPfusch
Copy link
Author

KeinPfusch commented Jun 17, 2020

Yes. I see there is one variable, which is read from config.

Let me explain better. According with the time/rate library, the burst represents the amount of events you may have in the same time, to descale the pool you have.

But, the way this module is using it, you receive ONE http call at a time. Which is what is passed for each call. So when I set a burst , it doesn't affects the behaviour. I noticed to change the burst was not affecting the behaviour, so I tried to understand how the burst variable is used.

Actually is not. Sure, Burst is there. But having one http request per time, is never being used. So I can set burst to 10 or to 1000 and the behaviour doesn't changes. Pool is always decreased of 1, apparently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants