spring-cloud / spring-cloud-commons

Common classes used in different Spring Cloud implementations
Apache License 2.0
704 stars 700 forks source link

deterministic subsetting algorithm to limit the number of instances #1288

Closed jizhuozhi closed 10 months ago

jizhuozhi commented 11 months ago

Is your feature request related to a problem? Please describe. Many RPCs use connection pools and long connections to reduce TCP handshake overhead (including RPC over HTTP). In a very large-scale cluster, there may be tens of thousands of instances (such as a search engine). If the client establishes connections with all instances, all available TCP ports will be quickly exhausted.

Describe the solution you'd like In order to solve this problem, in very large-scale clusters, each client should only select a limited subset to establish connections. Google SRE provides a deterministic subsetting algorithm solution, see https://sre.google/sre-book/load-balancing-datacenter