filestore_queue_high_delay_multiple
filestore_queue_max_delay_multiple
-While each throttle is at less than low_threshhold of the max,
+While each throttle is at less than low_threshold of the max,
no delay happens. Between low and high, the throttle will
inject a per-op delay (per op or byte) ramping from 0 at low to
high_delay_multiple/expected_throughput at high. From high to
}
bool BackoffThrottle::set_params(
- double _low_threshhold,
- double _high_threshhold,
+ double _low_threshold,
+ double _high_threshold,
double _expected_throughput,
double _high_multiple,
double _max_multiple,
ostream *errstream)
{
bool valid = true;
- if (_low_threshhold > _high_threshhold) {
+ if (_low_threshold > _high_threshold) {
valid = false;
if (errstream) {
- *errstream << "low_threshhold (" << _low_threshhold
- << ") > high_threshhold (" << _high_threshhold
+ *errstream << "low_threshold (" << _low_threshold
+ << ") > high_threshold (" << _high_threshold
<< ")" << std::endl;
}
}
}
}
- if (_low_threshhold > 1 || _low_threshhold < 0) {
+ if (_low_threshold > 1 || _low_threshold < 0) {
valid = false;
if (errstream) {
- *errstream << "invalid low_threshhold (" << _low_threshhold << ")"
+ *errstream << "invalid low_threshold (" << _low_threshold << ")"
<< std::endl;
}
}
- if (_high_threshhold > 1 || _high_threshhold < 0) {
+ if (_high_threshold > 1 || _high_threshold < 0) {
valid = false;
if (errstream) {
- *errstream << "invalid high_threshhold (" << _high_threshhold << ")"
+ *errstream << "invalid high_threshold (" << _high_threshold << ")"
<< std::endl;
}
}
return false;
locker l(lock);
- low_threshhold = _low_threshhold;
- high_threshhold = _high_threshhold;
+ low_threshold = _low_threshold;
+ high_threshold = _high_threshold;
high_delay_per_count = _high_multiple / _expected_throughput;
max_delay_per_count = _max_multiple / _expected_throughput;
max = _throttle_max;
if (logger)
logger->set(l_backoff_throttle_max, max);
- if (high_threshhold - low_threshhold > 0) {
- s0 = high_delay_per_count / (high_threshhold - low_threshhold);
+ if (high_threshold - low_threshold > 0) {
+ s0 = high_delay_per_count / (high_threshold - low_threshold);
} else {
- low_threshhold = high_threshhold;
+ low_threshold = high_threshold;
s0 = 0;
}
- if (1 - high_threshhold > 0) {
+ if (1 - high_threshold > 0) {
s1 = (max_delay_per_count - high_delay_per_count)
- / (1 - high_threshhold);
+ / (1 - high_threshold);
} else {
- high_threshhold = 1;
+ high_threshold = 1;
s1 = 0;
}
return std::chrono::duration<double>(0);
double r = ((double)current) / ((double)max);
- if (r < low_threshhold) {
+ if (r < low_threshold) {
return std::chrono::duration<double>(0);
- } else if (r < high_threshhold) {
+ } else if (r < high_threshold) {
return c * std::chrono::duration<double>(
- (r - low_threshhold) * s0);
+ (r - low_threshold) * s0);
} else {
return c * std::chrono::duration<double>(
- high_delay_per_count + ((r - high_threshhold) * s1));
+ high_delay_per_count + ((r - high_threshold) * s1));
}
}
* BackoffThrottle
*
* Creates a throttle which gradually induces delays when get() is called
- * based on params low_threshhold, high_threshhold, expected_throughput,
+ * based on params low_threshold, high_threshold, expected_throughput,
* high_multiple, and max_multiple.
*
- * In [0, low_threshhold), we want no delay.
+ * In [0, low_threshold), we want no delay.
*
- * In [low_threshhold, high_threshhold), delays should be injected based
- * on a line from 0 at low_threshhold to
- * high_multiple * (1/expected_throughput) at high_threshhold.
+ * In [low_threshold, high_threshold), delays should be injected based
+ * on a line from 0 at low_threshold to
+ * high_multiple * (1/expected_throughput) at high_threshold.
*
- * In [high_threshhold, 1), we want delays injected based on a line from
- * (high_multiple * (1/expected_throughput)) at high_threshhold to
+ * In [high_threshold, 1), we want delays injected based on a line from
+ * (high_multiple * (1/expected_throughput)) at high_threshold to
* (high_multiple * (1/expected_throughput)) +
* (max_multiple * (1/expected_throughput)) at 1.
*
- * Let the current throttle ratio (current/max) be r, low_threshhold be l,
- * high_threshhold be h, high_delay (high_multiple / expected_throughput) be e,
- * and max_delay (max_muliple / expected_throughput) be m.
+ * Let the current throttle ratio (current/max) be r, low_threshold be l,
+ * high_threshold be h, high_delay (high_multiple / expected_throughput) be e,
+ * and max_delay (max_multiple / expected_throughput) be m.
*
* delay = 0, r \in [0, l)
* delay = (r - l) * (e / (h - l)), r \in [l, h)
}
/// see above, values are in [0, 1].
- double low_threshhold = 0;
- double high_threshhold = 1;
+ double low_threshold = 0;
+ double high_threshold = 1;
/// see above, values are in seconds
double high_delay_per_count = 0;
* explanation.
*/
bool set_params(
- double low_threshhold,
- double high_threshhold,
+ double _low_threshold,
+ double _high_threshold,
double expected_throughput,
double high_multiple,
double max_multiple,
journal_throttle_max_multiple
This scheme will not be inducing any delay between [0, low_threshold].
-In [low_threshhold, high_threshhold), delays should be injected based on a line
-from 0 at low_threshold to high_multiple * (1/expected_throughput) at high_threshhold.
-In [high_threshhold, 1), we want delays injected based on a line from
-(high_multiple * (1/expected_throughput)) at high_threshhold to
+In [low_threshold, high_threshold), delays should be injected based on a line
+from 0 at low_threshold to high_multiple * (1/expected_throughput) at high_threshold.
+In [high_threshold, 1), we want delays injected based on a line from
+(high_multiple * (1/expected_throughput)) at high_threshold to
(high_multiple * (1/expected_throughput)) + (max_multiple * (1/expected_throughput))
at 1.
Now setting *_high_multiple and *_max_multiple to 0 should give us similar effect