Cache the size and the do bit whenever someone asked for it. We can probably add more: PASS BenchmarkStateDo-4 100000000 11.9 ns/op BenchmarkStateSize-4 5000000 265 ns/op ok github.com/miekg/coredns/middleware 2.828s PASS BenchmarkStateDo-4 1000000000 2.86 ns/op BenchmarkStateSize-4 500000000 3.10 ns/op ok github.com/miekg/coredns/middleware 5.032s This PR also includes some testing cleanups as well. |
||
---|---|---|
.. | ||
handler.go | ||
loadbalance.go | ||
loadbalance_test.go | ||
README.md |
loadbalance
loadbalance
acts as a round-robin DNS loadbalancer by randomizing A and AAAA records in the
message. See Wikipedia about the pros and cons
on this setup.
It will take care to sort any CNAMEs before any address records.
Syntax
loadbalance [policy]
policy
is how to balance, the default is "round_robin"
Examples
loadbalance round_robin