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

net: DNS load balancing during bursts of traffic #31698

shamwow opened this issue Apr 26, 2019 · 2 comments


Copy link

commented Apr 26, 2019

Right now inflight DNS lookups are grouped together.

Since DNS resolution picks the first available IP, this has the side effect of resolving the same IP when there are bursts in traffic.

This was surprising to me since I expected load to be distributed amongst the resolved hosts, especially during these bursts (assuming equal RFC 6724 weighting).

Load distribution via DNS seems like a common use case/expectation - it would be nice to be able to enable randomized DNS resolution. Being able to disable DNS query grouping or customize the way the group key is generated would also work.


This comment has been minimized.

Copy link

commented Apr 26, 2019

It does not make sense to me to start doing a separate DNS query for each connection. But perhaps if the DNS query returns multiple addresses, we could arrange for each member of the singleflight group to get a randomly chosen address.


This comment has been minimized.

Copy link

commented Apr 26, 2019

Randomizing each member of a singleflight group seems like it will require some amount of refactoring. For one, whether or not a request was in a group is entirely encapsulated by singleflight. Also, at the point singleflight is used, the addresses are already sorted by RFC6724.

So the grouping/randomization should be done before we apply the RFC6724 sorting rules[1] and there needs to be a way to know whether a request was grouped by singleflight.

[1] Another option is to randomize the resolved addresses and sort again by RFC6724 instead of moving where singleflight is called

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
3 participants
You can’t perform that action at this time.