From eb57f2e910c67fc76d240b31bed2307fa3c2956a Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Thu, 25 May 2023 10:49:19 -0700 Subject: [PATCH] [flow control] De-risk the memory flow controller (#33240) We were previously trying to adjust the initial guess flow control window *and* the adjustment methodology, which created some problems. The latter is more important for us to get in, so don't change the former for now (we can do that later). --- src/core/ext/transport/chttp2/transport/flow_control.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/core/ext/transport/chttp2/transport/flow_control.cc b/src/core/ext/transport/chttp2/transport/flow_control.cc index 6d5399b297c..bebdfbb8dad 100644 --- a/src/core/ext/transport/chttp2/transport/flow_control.cc +++ b/src/core/ext/transport/chttp2/transport/flow_control.cc @@ -244,7 +244,7 @@ TransportFlowControl::TargetInitialWindowSizeBasedOnMemoryPressureAndBdp() // // ▲ // │ - // 16mb ────┤---------x---- + // 4mb ────┤---------x---- // │ ----- // BDP ────┤ ----x--- // │ ---- @@ -259,7 +259,8 @@ TransportFlowControl::TargetInitialWindowSizeBasedOnMemoryPressureAndBdp() // pressure const double kAnythingGoesPressure = 0.2; const double kAdjustedToBdpPressure = 0.5; - const double kAnythingGoesWindow = std::max(double{1 << 24}, bdp); + const double kOneMegabyte = 1024.0 * 1024.0; + const double kAnythingGoesWindow = std::max(4.0 * kOneMegabyte, bdp); if (memory_pressure < kAnythingGoesPressure) { return kAnythingGoesWindow; } else if (memory_pressure < kAdjustedToBdpPressure) {