envoyproxy / envoy

Cloud-native high-performance edge/middle/service proxy
https://www.envoyproxy.io
Apache License 2.0
24.71k stars 4.75k forks source link

Happy Eyeball routines should not call sortAddress() in data path during creating connection #32916

Open yanjunxiang-google opened 6 months ago

yanjunxiang-google commented 6 months ago

Title: Happy Eyeball routines should not call sortAddress() in data path during creating connection

Description: Currently happy eyeball routine is calling sortAddress() in data. path when creating connection:

https://github.com/envoyproxy/envoy/blob/c9fb17a6fabd1d2030ce8f5192780e947a335e01/source/common/upstream/upstream_impl.cc#L531

https://github.com/envoyproxy/envoy/blob/c9fb17a6fabd1d2030ce8f5192780e947a335e01/source/common/network/happy_eyeballs_connection_impl.cc#L21

https://github.com/envoyproxy/envoy/blob/c9fb17a6fabd1d2030ce8f5192780e947a335e01/source/common/network/happy_eyeballs_connection_impl.cc#L103

If the address vector is relatively big, and rarely changes, which is normal, then this is very inefficient.

The code should try to sort the address in control plane, like DNS refreshing, when new addresses are added to the host, and store that sorted result in host. And data plane just use that sorted result.

yanjunxiang-google commented 6 months ago

/assign @RyanTheOptimist @yanavlasov @adisuissa

github-actions[bot] commented 5 months ago

This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged "help wanted" or "no stalebot" or other activity occurs. Thank you for your contributions.

yanjunxiang-google commented 5 months ago

/wait

github-actions[bot] commented 4 months ago

This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged "help wanted" or "no stalebot" or other activity occurs. Thank you for your contributions.