vitess_grpc/generated/throttlerdata.rs
1/// MaxRatesRequest is the payload for the MaxRates RPC.
2#[allow(clippy::derive_partial_eq_without_eq)]
3#[derive(Clone, PartialEq, ::prost::Message)]
4pub struct MaxRatesRequest {}
5/// MaxRatesResponse is returned by the MaxRates RPC.
6#[allow(clippy::derive_partial_eq_without_eq)]
7#[derive(Clone, PartialEq, ::prost::Message)]
8pub struct MaxRatesResponse {
9 /// max_rates returns the max rate for each throttler. It's keyed by the
10 /// throttler name.
11 #[prost(map = "string, int64", tag = "1")]
12 pub rates: ::std::collections::HashMap<::prost::alloc::string::String, i64>,
13}
14/// SetMaxRateRequest is the payload for the SetMaxRate RPC.
15#[allow(clippy::derive_partial_eq_without_eq)]
16#[derive(Clone, PartialEq, ::prost::Message)]
17pub struct SetMaxRateRequest {
18 #[prost(int64, tag = "1")]
19 pub rate: i64,
20}
21/// SetMaxRateResponse is returned by the SetMaxRate RPC.
22#[allow(clippy::derive_partial_eq_without_eq)]
23#[derive(Clone, PartialEq, ::prost::Message)]
24pub struct SetMaxRateResponse {
25 /// names is the list of throttler names which were updated.
26 #[prost(string, repeated, tag = "1")]
27 pub names: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
28}
29/// Configuration holds the configuration parameters for the
30/// MaxReplicationLagModule which adaptively adjusts the throttling rate based on
31/// the observed replication lag across all replicas.
32#[allow(clippy::derive_partial_eq_without_eq)]
33#[derive(Clone, PartialEq, ::prost::Message)]
34pub struct Configuration {
35 /// target_replication_lag_sec is the replication lag (in seconds) the
36 /// MaxReplicationLagModule tries to aim for.
37 /// If it is within the target, it tries to increase the throttler
38 /// rate, otherwise it will lower it based on an educated guess of the
39 /// replica's throughput.
40 #[prost(int64, tag = "1")]
41 pub target_replication_lag_sec: i64,
42 /// max_replication_lag_sec is meant as a last resort.
43 /// By default, the module tries to find out the system maximum capacity while
44 /// trying to keep the replication lag around "target_replication_lag_sec".
45 /// Usually, we'll wait min_duration_between_(increases|decreases)_sec to see
46 /// the effect of a throttler rate change on the replication lag.
47 /// But if the lag goes above this field's value we will go into an "emergency"
48 /// state and throttle more aggressively (see "emergency_decrease" below).
49 /// This is the only way to ensure that the system will recover.
50 #[prost(int64, tag = "2")]
51 pub max_replication_lag_sec: i64,
52 /// initial_rate is the rate at which the module will start.
53 #[prost(int64, tag = "3")]
54 pub initial_rate: i64,
55 /// max_increase defines by how much we will increase the rate
56 /// e.g. 0.05 increases the rate by 5% while 1.0 by 100%.
57 /// Note that any increase will let the system wait for at least
58 /// (1 / MaxIncrease) seconds. If we wait for shorter periods of time, we
59 /// won't notice if the rate increase also increases the replication lag.
60 /// (If the system was already at its maximum capacity (e.g. 1k QPS) and we
61 /// increase the rate by e.g. 5% to 1050 QPS, it will take 20 seconds until
62 /// 1000 extra queries are buffered and the lag increases by 1 second.)
63 #[prost(double, tag = "4")]
64 pub max_increase: f64,
65 /// emergency_decrease defines by how much we will decrease the current rate
66 /// if the observed replication lag is above "max_replication_lag_sec".
67 /// E.g. 0.50 decreases the current rate by 50%.
68 #[prost(double, tag = "5")]
69 pub emergency_decrease: f64,
70 /// min_duration_between_increases_sec specifies how long we'll wait at least
71 /// for the last rate increase to have an effect on the system.
72 #[prost(int64, tag = "6")]
73 pub min_duration_between_increases_sec: i64,
74 /// max_duration_between_increases_sec specifies how long we'll wait at most
75 /// for the last rate increase to have an effect on the system.
76 #[prost(int64, tag = "7")]
77 pub max_duration_between_increases_sec: i64,
78 /// min_duration_between_decreases_sec specifies how long we'll wait at least
79 /// for the last rate decrease to have an effect on the system.
80 #[prost(int64, tag = "8")]
81 pub min_duration_between_decreases_sec: i64,
82 /// spread_backlog_across_sec is used when we set the throttler rate after
83 /// we guessed the rate of a replica and determined its backlog.
84 /// For example, at a guessed rate of 100 QPS and a lag of 10s, the replica has
85 /// a backlog of 1000 queries.
86 /// When we set the new, decreased throttler rate, we factor in how long it
87 /// will take the replica to go through the backlog (in addition to new
88 /// requests). This field specifies over which timespan we plan to spread this.
89 /// For example, for a backlog of 1000 queries spread over 5s means that we
90 /// have to further reduce the rate by 200 QPS or the backlog will not be
91 /// processed within the 5 seconds.
92 #[prost(int64, tag = "9")]
93 pub spread_backlog_across_sec: i64,
94 /// ignore_n_slowest_replicas will ignore replication lag updates from the
95 /// N slowest REPLICA tablets. Under certain circumstances, replicas are still
96 /// considered e.g. a) if the lag is at most max_replication_lag_sec, b) there
97 /// are less than N+1 replicas or c) the lag increased on each replica such
98 /// that all replicas were ignored in a row.
99 #[prost(int32, tag = "10")]
100 pub ignore_n_slowest_replicas: i32,
101 /// ignore_n_slowest_rdonlys does the same thing as ignore_n_slowest_replicas
102 /// but for RDONLY tablets. Note that these two settings are independent.
103 #[prost(int32, tag = "11")]
104 pub ignore_n_slowest_rdonlys: i32,
105 /// age_bad_rate_after_sec is the duration after which an unchanged bad rate
106 /// will "age out" and increase by "bad_rate_increase".
107 /// Bad rates are tracked by the code in memory.go and serve as an upper bound
108 /// for future rate changes. This ensures that the adaptive throttler does not
109 /// try known too high (bad) rates over and over again.
110 /// To avoid that temporary degradations permanently reduce the maximum rate,
111 /// a stable bad rate "ages out" after "age_bad_rate_after_sec".
112 #[prost(int64, tag = "12")]
113 pub age_bad_rate_after_sec: i64,
114 /// bad_rate_increase defines the percentage by which a bad rate will be
115 /// increased when it's aging out.
116 #[prost(double, tag = "13")]
117 pub bad_rate_increase: f64,
118 /// max_rate_approach_threshold is the fraction of the current rate limit that the actual
119 /// rate must exceed for the throttler to increase the limit when the replication lag
120 /// is below target_replication_lag_sec. For example, assuming the actual replication lag
121 /// is below target_replication_lag_sec, if the current rate limit is 100, then the actual
122 /// rate must exceed 100*max_rate_approach_threshold for the throttler to increase the current
123 /// limit.
124 #[prost(double, tag = "14")]
125 pub max_rate_approach_threshold: f64,
126}
127/// GetConfigurationRequest is the payload for the GetConfiguration RPC.
128#[allow(clippy::derive_partial_eq_without_eq)]
129#[derive(Clone, PartialEq, ::prost::Message)]
130pub struct GetConfigurationRequest {
131 /// throttler_name specifies which throttler to select. If empty, all active
132 /// throttlers will be selected.
133 #[prost(string, tag = "1")]
134 pub throttler_name: ::prost::alloc::string::String,
135}
136/// GetConfigurationResponse is returned by the GetConfiguration RPC.
137#[allow(clippy::derive_partial_eq_without_eq)]
138#[derive(Clone, PartialEq, ::prost::Message)]
139pub struct GetConfigurationResponse {
140 /// max_rates returns the configurations for each throttler.
141 /// It's keyed by the throttler name.
142 #[prost(map = "string, message", tag = "1")]
143 pub configurations: ::std::collections::HashMap<
144 ::prost::alloc::string::String,
145 Configuration,
146 >,
147}
148/// UpdateConfigurationRequest is the payload for the UpdateConfiguration RPC.
149#[allow(clippy::derive_partial_eq_without_eq)]
150#[derive(Clone, PartialEq, ::prost::Message)]
151pub struct UpdateConfigurationRequest {
152 /// throttler_name specifies which throttler to update. If empty, all active
153 /// throttlers will be updated.
154 #[prost(string, tag = "1")]
155 pub throttler_name: ::prost::alloc::string::String,
156 /// configuration is the new (partial) configuration.
157 #[prost(message, optional, tag = "2")]
158 pub configuration: ::core::option::Option<Configuration>,
159 /// copy_zero_values specifies whether fields with zero values should be copied
160 /// as well.
161 #[prost(bool, tag = "3")]
162 pub copy_zero_values: bool,
163}
164/// UpdateConfigurationResponse is returned by the UpdateConfiguration RPC.
165#[allow(clippy::derive_partial_eq_without_eq)]
166#[derive(Clone, PartialEq, ::prost::Message)]
167pub struct UpdateConfigurationResponse {
168 /// names is the list of throttler names which were updated.
169 #[prost(string, repeated, tag = "1")]
170 pub names: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
171}
172/// ResetConfigurationRequest is the payload for the ResetConfiguration RPC.
173#[allow(clippy::derive_partial_eq_without_eq)]
174#[derive(Clone, PartialEq, ::prost::Message)]
175pub struct ResetConfigurationRequest {
176 /// throttler_name specifies which throttler to reset. If empty, all active
177 /// throttlers will be reset.
178 #[prost(string, tag = "1")]
179 pub throttler_name: ::prost::alloc::string::String,
180}
181/// ResetConfigurationResponse is returned by the ResetConfiguration RPC.
182#[allow(clippy::derive_partial_eq_without_eq)]
183#[derive(Clone, PartialEq, ::prost::Message)]
184pub struct ResetConfigurationResponse {
185 /// names is the list of throttler names which were updated.
186 #[prost(string, repeated, tag = "1")]
187 pub names: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
188}