mirror of
https://github.com/DNSCrypt/dnscrypt-proxy.git
synced 2025-03-04 02:14:40 +01:00
minor typo and grammar fixes
parent
fa6761ab4c
commit
9fde9d4a3f
1 changed files with 4 additions and 4 deletions
|
@ -1,6 +1,6 @@
|
|||
# Load Balancing
|
||||
|
||||
`dnscrypt-proxy` comes with a load balancing algorithm. It will send consecutive DNS queries to different DNS servers randomly choosen from a sorted (fastest to slowest) set of a choosen size. The size of that set is what you can choose in the configuration file with the `lb_strategy` parameter. A server will be choosen randomly among the N fastest servers in your list of servers (or if you are not specifically choosing servers with the `server_names` parameter, among the N fastest servers from all servers that match your requirements.)
|
||||
`dnscrypt-proxy` comes with a load balancing algorithm. It will send consecutive DNS queries to different DNS servers randomly chosen from a sorted (from fastest to slowest) set of a chosen size. The size of that set is what you can choose in the configuration file with the `lb_strategy` parameter. A server will be chosen randomly among the N fastest servers in your list of servers (or if you are not specifically choosing servers with the `server_names` parameter, among the N fastest servers from all servers that match your requirements.)
|
||||
|
||||
## How The List Of Servers Is Populated
|
||||
|
||||
|
@ -16,13 +16,13 @@ It calculates an initial RTT (Round-Trip Time) estimation for each resolver (for
|
|||
|
||||
`dnscrypt-proxy` keeps the list of servers sorted at all times.
|
||||
|
||||
Each time a query is made to a server, the time it takes is used to adjust how fast `dnscrypt-proxy` thinks that the server is, using an exponentially weighted moving average. If the newly adjusted RTT of the resolver that was just used happens to be bigger (slower) than a randomly choosen candidate from the list of all servers, then these entries are swapped.
|
||||
Each time a query is made to a server, the time it takes is used to adjust how fast `dnscrypt-proxy` thinks that the server is, using an exponentially weighted moving average. If the newly adjusted RTT of the resolver that was just used happens to be bigger (slower) than a randomly chosen candidate from the list of all servers, then these entries are swapped.
|
||||
|
||||
Over time, every server gets compared to all other servers and the list is progressively kept sorted. Slow servers will probably never compare favorably with the fast servers and will remain at the bottom of the list. Since response times vary appreciably even for the same server, especially as DNS servers need to query other servers to resolve domains when they are not in the cache, the servers at the top of the list might move around as time goes by even if they are close to you.
|
||||
|
||||
## Load-balancing options
|
||||
|
||||
So, the servers are sorted from quickest to slowest. The load balancing is done using that list. You have a choice of 4 different ranges/sets from which to choose the server that will next be queried. The server is choosen randomly inside that set. The 4 possible values of the `lb_strategy` parameter are:
|
||||
So, the servers are sorted from quickest to slowest. The load balancing is done using that list. You have a choice of 4 different ranges/sets from which to choose the server that will next be queried. The server is chosen randomly inside that set. The 4 possible values of the `lb_strategy` parameter are:
|
||||
|
||||
* `first` (always pick the fastest server in the list)
|
||||
* `p2` (randomly choose between the top 2 fastest servers)
|
||||
|
@ -31,7 +31,7 @@ So, the servers are sorted from quickest to slowest. The load balancing is done
|
|||
|
||||
This setting is a string, so you use `lb_strategy = 'p2'` in the configuration file.
|
||||
|
||||
The default strategy is `p2` so `dnscrypt-proxy` will pick one of the two fastest servers. It will compare how fast that server was with a randomly choosen server and if that random server is faster, the random server will move up. The same is true for all strategies - random servers will move up in the list when they are faster than the server that was just queried.
|
||||
The default strategy is `p2` so `dnscrypt-proxy` will pick one of the two fastest servers. It will compare how fast that server was with a randomly chosen server and if that random server is faster, the random server will move up. The same is true for all strategies - random servers will move up in the list when they are faster than the server that was just queried.
|
||||
|
||||
## Notes
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue