-
Notifications
You must be signed in to change notification settings - Fork 221
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
Add backend weight round robin select #34
Conversation
- random selector - weight random selector random selector will choose upstream at random; weight random selector will choose upstream at random with weight Signed-off-by: Sherlock Holo <sherlockya@gmail.com>
…in selector Signed-off-by: Sherlock Holo <sherlockya@gmail.com>
…bin selector, the algorithm is nginx weight round robbin like Signed-off-by: Sherlock Holo <sherlockya@gmail.com>
Signed-off-by: Sherlock Holo <sherlockya@gmail.com>
Signed-off-by: Sherlock Holo <sherlockya@gmail.com>
Thank you for the major contribution! I guess it provides a solution for issue #24. |
Signed-off-by: Sherlock Holo <sherlockya@gmail.com>
Actually I don't add any new dependenices, so it should work well for all paltforms as in the past |
I thinks we should let user know how to set upstream weight legitimately, and we may need to talk about:
1 and 2 are different, if upstream timeout, usually upstream will be unavailable for a long time, but if it returns 5xx, maybe it just a lot of users query it, it may return to normal quickly |
We could set the penalty increase exponentially (like in power if around 1.6), but switch to linear after some number of fails, and cap it with a maximum value. And we always make sure we have at least one server to query even if all servers seem unavailable. |
yes and we may can learn from some load b balance stuck as traefik |
Signed-off-by: Sherlock Holo <sherlockya@gmail.com>
Signed-off-by: Sherlock Holo <sherlockya@gmail.com>
Signed-off-by: Sherlock Holo <sherlockya@gmail.com>
Please make some very small changes before I merge :-) |
Signed-off-by: Sherlock Holo <sherlockya@gmail.com>
Signed-off-by: Sherlock Holo <sherlockya@gmail.com>
The |
I think I should rewrite the |
Actually I didn't intend to use a complex format like TOML to represent our configuration files. Therefore the configuration is actually a simple format (until this pull request) which actually doesn't need any syntax highlighting. Additionally systemd's configuration files also uses different suffixes (.conf, .service, .target, .socket, etc). I think Goland is to blame for not recognizing this. Finally, if we break the compatibility of the configuration files, we need to bump the major version number. |
I would really appreciate for your contributions! |
This PR add |
Signed-off-by: Sherlock Holo <sherlockya@gmail.com>
Signed-off-by: Sherlock Holo <sherlockya@gmail.com>
Signed-off-by: Sherlock Holo <sherlockya@gmail.com>
Signed-off-by: Sherlock Holo <sherlockya@gmail.com>
…ion loop in real time Signed-off-by: Sherlock Holo <sherlockya@gmail.com>
I rewrite |
I tested on my PC. Thank you for the new deadline detection code. But one more question: should we make Also, I hope all |
it should be private, I will change it tomorrow
Star Brilliant <notifications@github.com> 于 2019年3月7日周四 23:59写道:
… I tested on my PC.
Thank you for the new deadline detection code.
But one more question: should we make Client.Selector private or public?
I guess we don't need to share it with other packages?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#34 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AJoPKRlR_UNqLIvqtRgtp0GJOvXQTx6Xks5vUTdsgaJpZM4bgExh>
.
|
Signed-off-by: Sherlock Holo <sherlockya@gmail.com>
Change it pivate now |
Thank you for the change! Shall I make the last 2 changes for you, or you will do the changes before I merge? |
|
Add miss space for 'weight= 50' Signed-off-by: Sherlock Holo <sherlockya@gmail.com>
…, report upstream ok in real time Signed-off-by: Sherlock Holo <sherlockya@gmail.com>
Signed-off-by: Sherlock Holo <sherlockya@gmail.com>
|
I upgrade |
add
Selector
selector
implementRandomSelector
selector
implementWeightRoundRobinSelector
reason
dns-over-https
allow us to set multi backends. However, sometimes some backends will be unavailable, we need a algorithm to reduce probability of thems. WRR algorithm is a good way.