github.com/bazelbuild/remote-apis-sdks@v0.0.0-20240425170053-8a36686a6350/go/pkg/balancer/proto/grpcbalancer.proto (about) 1 syntax = "proto3"; 2 3 package grpcbalancer; 4 5 message ApiConfig { 6 // The channel pool configurations. 7 ChannelPoolConfig channel_pool = 2; 8 9 // The method configurations. 10 repeated MethodConfig method = 1001; 11 } 12 13 // ChannelPoolConfig are options for configuring the channel pool. 14 // RPCs will be scheduled onto existing channels in the pool until all channels 15 // have <max_concurrent_streams_low_watermark> number of streams. At this point 16 // a new channel is spun out. Once <max_size> channels have been spun out and 17 // each has <max_concurrent_streams_low_watermark> streams, subsequent RPCs will 18 // hang until any of the in-flight RPCs is finished, freeing up a channel. 19 message ChannelPoolConfig { 20 // The max number of channels in the pool. 21 // Default value is 0, meaning 'unlimited' size. 22 uint32 max_size = 1; 23 24 // The idle timeout (seconds) of channels without bound affinity sessions. 25 uint64 idle_timeout = 2; 26 27 // The low watermark of max number of concurrent streams in a channel. 28 // New channel will be created once it get hit, until we reach the max size of the channel pool. 29 // Default value is 100. The valid range is [1, 100]. Any value outside the range will be ignored and the default value will be used. 30 // Note: It is not recommended that users adjust this value, since a single channel should generally have no trouble managing the default (maximum) number of streams. 31 uint32 max_concurrent_streams_low_watermark = 3; 32 } 33 34 message MethodConfig { 35 // A fully qualified name of a gRPC method, or a wildcard pattern ending 36 // with .*, such as foo.bar.A, foo.bar.*. Method configs are evaluated 37 // sequentially, and the first one takes precedence. 38 repeated string name = 1; 39 40 // The channel affinity configurations. 41 AffinityConfig affinity = 1001; 42 } 43 44 message AffinityConfig { 45 enum Command { 46 // The annotated method will be required to be bound to an existing session 47 // to execute the RPC. The corresponding <affinity_key_field_path> will be 48 // used to find the affinity key from the request message. 49 BOUND = 0; 50 // The annotated method will establish the channel affinity with the 51 // channel which is used to execute the RPC. The corresponding 52 // <affinity_key_field_path> will be used to find the affinity key from the 53 // response message. 54 BIND = 1; 55 // The annotated method will remove the channel affinity with the 56 // channel which is used to execute the RPC. The corresponding 57 // <affinity_key_field_path> will be used to find the affinity key from the 58 // request message. 59 UNBIND = 2; 60 } 61 // The affinity command applies on the selected gRPC methods. 62 Command command = 2; 63 // The field path of the affinity key in the request/response message. 64 // For example: "f.a", "f.b.d", etc. 65 string affinity_key = 3; 66 }