blueszhangsh opened a new issue, #1747:
URL: https://github.com/apache/incubator-brpc/issues/1747
```
int32_t total_succ_req =
_total_succ_req.load(butil::memory_order_relaxed);
double failed_punish = _sw.total_failed_us *
FLAGS_auto_cl_fail_punish_ratio;
int64_t avg_latency =
std::ceil((failed_punish + _sw.total_succ_us) / _sw.succ_count);
double qps = 1000000.0 * total_succ_req / (sampling_time_us -
_sw.start_time_us);
UpdateMinLatency(avg_latency);
UpdateQps(qps);
int next_max_concurrency = 0;
// Remeasure min_latency at regular intervals
if (_remeasure_start_us <= sampling_time_us) {
const double reduce_ratio =
FLAGS_auto_cl_reduce_ratio_while_remeasure;
_reset_latency_us = sampling_time_us + avg_latency * 2;
next_max_concurrency =
std::ceil(_ema_max_qps * _min_latency_us / 1000000 *
reduce_ratio);
} else {
const double change_step =
FLAGS_auto_cl_change_rate_of_explore_ratio;
const double max_explore_ratio = FLAGS_auto_cl_max_explore_ratio;
const double min_explore_ratio = FLAGS_auto_cl_min_explore_ratio;
const double correction_factor =
FLAGS_auto_cl_latency_fluctuation_correction_factor;
if (avg_latency <= _min_latency_us * (1.0 + min_explore_ratio *
correction_factor) ||
qps <= _ema_max_qps / (1.0 + min_explore_ratio)) {
_explore_ratio = std::min(max_explore_ratio, _explore_ratio +
change_step);
} else {
_explore_ratio = std::max(min_explore_ratio, _explore_ratio -
change_step);
}
next_max_concurrency =
_min_latency_us * _ema_max_qps / 1000000 * (1 + _explore_ratio);
}
```
这处的算法和文档中描述的```max_concurrency = max_qps * ((2+alpha) * min_latency -
latency)```有所不同。可否详细解释一下master分支的这套算法呢?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]