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

Open
shamwow opened this issue Apr 26, 2019 · 2 comments
Open

net: DNS load balancing during bursts of traffic #31698

shamwow opened this issue Apr 26, 2019 · 2 comments
Labels
FeatureRequest NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@shamwow
Copy link

shamwow 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.

@ALTree ALTree added FeatureRequest NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. labels Apr 26, 2019
@ianlancetaylor
Copy link
Member

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.

@ianlancetaylor ianlancetaylor added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. and removed NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. labels Apr 26, 2019
@ianlancetaylor ianlancetaylor added this to the Unplanned milestone Apr 26, 2019
@shamwow
Copy link
Author

shamwow 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
Labels
FeatureRequest NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

3 participants