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 lowest picker load: active streams plus active error penalty. 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 |
Samples two channels at random with replacement and returns the one with lower picker load. The first sample wins ties, with no channel-warmth preference. Inactive or draining samples are retried.
This is the default strategy. It avoids the thundering herd problem. The trade-off is that it may not always find the global minimum, but in practice the difference is negligible because picker load is inherently racy. |
Static Methods |
|
|---|---|
| Name | Description |
valueOf(String name) |
|
values() |
|