nghttpx: Add support QUIC BBR2

This commit is contained in:
Tatsuhiro Tsujikawa 2022-02-10 19:45:30 +09:00
parent f3206b12d5
commit 385abf10f7
3 changed files with 14 additions and 5 deletions

View File

@ -3369,12 +3369,15 @@ HTTP/3 and QUIC:
NEW_TOKEN frame in the previous connection. NEW_TOKEN frame in the previous connection.
--frontend-quic-congestion-controller=<CC> --frontend-quic-congestion-controller=<CC>
Specify a congestion controller algorithm for a frontend Specify a congestion controller algorithm for a frontend
QUIC connection. <CC> should be either "cubic" or QUIC connection. <CC> should be one of "cubic", "bbr",
"bbr". and "bbr2".
Default: )" Default: )"
<< (config->quic.upstream.congestion_controller == NGTCP2_CC_ALGO_CUBIC << (config->quic.upstream.congestion_controller == NGTCP2_CC_ALGO_CUBIC
? "cubic" ? "cubic"
: "bbr") : (config->quic.upstream.congestion_controller ==
NGTCP2_CC_ALGO_BBR
? "bbr"
: "bbr2"))
<< R"( << R"(
--frontend-quic-secret-file=<PATH> --frontend-quic-secret-file=<PATH>
Path to file that contains secure random data to be used Path to file that contains secure random data to be used

View File

@ -4111,8 +4111,10 @@ int parse_config(Config *config, int optid, const StringRef &opt,
config->quic.upstream.congestion_controller = NGTCP2_CC_ALGO_CUBIC; config->quic.upstream.congestion_controller = NGTCP2_CC_ALGO_CUBIC;
} else if (util::strieq_l("bbr", optarg)) { } else if (util::strieq_l("bbr", optarg)) {
config->quic.upstream.congestion_controller = NGTCP2_CC_ALGO_BBR; config->quic.upstream.congestion_controller = NGTCP2_CC_ALGO_BBR;
} else if (util::strieq_l("bbr2", optarg)) {
config->quic.upstream.congestion_controller = NGTCP2_CC_ALGO_BBR2;
} else { } else {
LOG(ERROR) << opt << ": must be either cubic or bbr"; LOG(ERROR) << opt << ": must be one of cubic, bbr, and bbr2";
return -1; return -1;
} }
#endif // ENABLE_HTTP3 #endif // ENABLE_HTTP3

View File

@ -745,7 +745,11 @@ int Http3Upstream::write_streams() {
auto config = get_config(); auto config = get_config();
auto &quicconf = config->quic; auto &quicconf = config->quic;
if (quicconf.upstream.congestion_controller != NGTCP2_CC_ALGO_BBR) { switch (quicconf.upstream.congestion_controller) {
case NGTCP2_CC_ALGO_BBR:
case NGTCP2_CC_ALGO_BBR2:
break;
default:
max_pktcnt = std::min(max_pktcnt, static_cast<size_t>(10)); max_pktcnt = std::min(max_pktcnt, static_cast<size_t>(10));
} }