public enum GcpManagedChannelOptions.ChannelPickStrategy extends Enum<GcpManagedChannelOptions.ChannelPickStrategy>Strategy for picking the least busy channel from the pool.
This controls how a channel is selected when there is no affinity key or when a new affinity binding is being established.
Static Fields |
|
|---|---|
| Name | Description |
LINEAR_SCAN |
Scans all channels and picks the one with the fewest active streams. Ties are broken by iteration order (lowest index wins). This is the legacy behavior.
This strategy finds the global minimum but is susceptible to the thundering herd problem: under burst traffic, all concurrent callers observe the same minimum and pile onto the same channel. |
POWER_OF_TWO |
Picks two channels at random and returns the one with fewer active streams. Ties are broken by preferring the more recently active channel (warmth-preserving).
This is the default strategy. It avoids the thundering herd problem while keeping warm channels preferred under low traffic. The trade-off is that it may not always find the global minimum, but in practice the difference is negligible because stream counts are inherently racy. |
Static Methods |
|
|---|---|
| Name | Description |
valueOf(String name) |
|
values() |
|