sessionOptions.initialRtt


  • 类型:<bigint> | <number>
  • 默认: 0(使用 ngtcp2 的默认值 333 毫秒)

指定以毫秒为单位的初始往返时间估计值。这个值用于探测超时(PTO)计算、初始限速以及在连接收集到第一个实际RTT样本之前的早期丢包检测。默认的333毫秒适合普通的互联网环境。对于低延迟环境,比如回环或同机架部署,将该值设置得更接近实际RTT(例如 1)可以避免不必要的保守初始行为。

🌐 Specifies the initial round-trip time estimate in milliseconds. This value is used for probe timeout (PTO) computation, initial pacing, and early loss detection before the first actual RTT sample is collected from the connection. The default of 333ms is appropriate for the general internet. For low-latency environments such as loopback or same-rack deployments, setting a value closer to the actual RTT (e.g., 1) avoids unnecessarily conservative initial behavior.