From 73fc51c4cae8067399af54e183c807105c3653c9 Mon Sep 17 00:00:00 2001 From: Guang Yang Date: Thu, 7 Jul 2022 19:34:49 +0800 Subject: [PATCH] Change the minimum numerator that affect time_factor to 1 second,or it will cause big edf entry deadline, and the entry will not be selected in a long time. Signed-off-by: Guang Yang --- source/common/upstream/load_balancer_impl.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/common/upstream/load_balancer_impl.cc b/source/common/upstream/load_balancer_impl.cc index 593cd911b4b13..7f4a029f20400 100644 --- a/source/common/upstream/load_balancer_impl.cc +++ b/source/common/upstream/load_balancer_impl.cc @@ -1004,7 +1004,7 @@ double EdfLoadBalancerBase::applySlowStartFactor(double host_weight, const Host& } ASSERT(aggression_ > 0.0); - auto time_factor = static_cast(std::max(std::chrono::milliseconds(1).count(), + auto time_factor = static_cast(std::max(std::chrono::milliseconds(1000).count(), host_create_duration.count())) / slow_start_window_.count(); return host_weight *