Closed Sherlock-Holo closed 5 years ago
Thank you for the major contribution!
I guess it provides a solution for issue #24. I will test it when I reach home. If it builds on all platforms and worked well, I will merge it.
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
Please make some very small changes before I merge :-)
The doh-client.conf
actually is a toml config file, could we change the name suffix to toml
? some text editor may only check name suffix, they won't highlight the content because they don't know what it is, such as Goland :-(
I think I should rewrite the Selector
interface because it doesn't provide a way to reduce weight in real time. I think reducing weight in real time is necessary.
The
doh-client.conf
actually is a toml config file, could we change the name suffix totoml
? some text editor may only check name suffix, they won't highlight the content because they don't know what it is, such as Goland :-(
Actually I didn't intend to use a complex format like TOML to represent our configuration files. What I expect is something like INI or systemd's configuration files. They are just lucky to be compatible with TOML.
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 think I should rewrite the
Selector
interface because it doesn't provide a way to reduce weight in real time. I think reducing weight in real time is necessary.
I would really appreciate for your contributions! I am sorry that I am too busy these months.
This PR add Selector
interface and wrr selector implement, so user should write every upsteam's weight, use TOML
syntax will reudce compatible break. So we have to bump the major version number ^_^
I rewrite Selector
interface and do a simple test in my PC, the wrr selector works well
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?
Also, I hope all weight= 50
can be replaced by weight = 50
, Url
can be replaced by URL
.
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 https://github.com/m13253/dns-over-https/pull/34#issuecomment-470583472, or mute the thread https://github.com/notifications/unsubscribe-auth/AJoPKRlR_UNqLIvqtRgtp0GJOvXQTx6Xks5vUTdsgaJpZM4bgExh .
Change it pivate now
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?
Also, I hope all
weight= 50
can be replaced byweight = 50
,Url
can be replaced byURL
.
weight= 50
fixedUrl
now is URL
I upgrade Selector
, now can report upstream works well. I add it because when I run it on our school DNS server, after reading logs, it seems wrr selector "drop" some upstreams because wrr selector reduce their weight too fast but icrease weight too slow when they are available, so we should increase weight when upstreams are available in real time
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.