pub struct RpcCompressionConfig {
pub replication_response: bool,
pub election_response: bool,
pub snapshot_response: bool,
pub cluster_response: bool,
pub client_response: bool,
}Expand description
Configuration for controlling gRPC compression settings per service type
Provides fine-grained control over when to enable compression based on the RPC service type and deployment environment. Each service can be independently configured to use compression based on its data characteristics and frequency.
Fields§
§replication_response: boolControls compression for Raft replication response data
Replication traffic is typically high-frequency with small payloads in LAN environments, making compression less beneficial. In WAN deployments with bandwidth constraints, enabling may help.
Default: false - Optimized for LAN/same-VPC deployments
election_response: boolControls compression for Raft election response data
Election traffic is low-frequency but time-sensitive. Compression rarely benefits election traffic due to small payload size.
Default: true for backward compatibility
snapshot_response: boolControls compression for snapshot transfer response data
Snapshot transfers involve large data volumes where compression is typically beneficial, even in low-latency environments.
Default: true - Recommended for all environments
cluster_response: boolControls compression for cluster management response data
Cluster operations are infrequent but may contain configuration data. Compression is generally beneficial for these operations.
Default: true for backward compatibility
client_response: boolControls compression for client request response data
Client responses may vary in size. In LAN/VPC environments, compression CPU overhead typically outweighs network benefits.
Default: false - Optimized for LAN/same-VPC deployments
Trait Implementations§
Source§impl Clone for RpcCompressionConfig
impl Clone for RpcCompressionConfig
Source§fn clone(&self) -> RpcCompressionConfig
fn clone(&self) -> RpcCompressionConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RpcCompressionConfig
impl Debug for RpcCompressionConfig
Source§impl Default for RpcCompressionConfig
impl Default for RpcCompressionConfig
Source§impl<'de> Deserialize<'de> for RpcCompressionConfig
impl<'de> Deserialize<'de> for RpcCompressionConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for RpcCompressionConfig
impl RefUnwindSafe for RpcCompressionConfig
impl Send for RpcCompressionConfig
impl Sync for RpcCompressionConfig
impl Unpin for RpcCompressionConfig
impl UnwindSafe for RpcCompressionConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request