Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
net/http: Client round-robin across persistent connections #34511
When connecting directly to a service spread across multiple hosts with DNS "load-balancing" it would be ideal if
Right now, if you want to ensure that load is balanced the only practical option is to disable HTTP keepalives.
One way this could be done is to have idle connection pools for each different A record, and do a DNS resolution for every request to decide which pool to use for that request.
This round-robin mode should likely be opt-in. When enabled, given a DNS record like the following: