diff options
author | Mike Perry <mikeperry-git@torproject.org> | 2022-07-31 15:09:35 +0000 |
---|---|---|
committer | David Goulet <dgoulet@torproject.org> | 2022-08-11 09:26:51 -0400 |
commit | 4444f5f4ed968f08d26735a2531f03a6c4369226 (patch) | |
tree | 43774ed5e60b86c32830323fa6b5a72ad011e5f3 /src/core | |
parent | 08c3ee8eca4bf60f3218daeb65acf97da554e80f (diff) | |
download | tor-4444f5f4ed968f08d26735a2531f03a6c4369226.tar.gz tor-4444f5f4ed968f08d26735a2531f03a6c4369226.zip |
Use EWMA instead of bare rtt for min rtt.
This allows us to average out minimums due to lulls in activity a bit more.
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/or/congestion_control_common.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/core/or/congestion_control_common.c b/src/core/or/congestion_control_common.c index c1a62cada0..b90c78729a 100644 --- a/src/core/or/congestion_control_common.c +++ b/src/core/or/congestion_control_common.c @@ -857,8 +857,10 @@ congestion_control_update_circuit_rtt(congestion_control_t *cc, cc->max_rtt_usec = rtt; } - if (cc->min_rtt_usec == 0 || rtt < cc->min_rtt_usec) { - cc->min_rtt_usec = rtt; + if (cc->min_rtt_usec == 0 || cc->ewma_rtt_usec < cc->min_rtt_usec) { + // Using the EWMA for min instead of current RTT helps average out + // effects from other conns + cc->min_rtt_usec = cc->ewma_rtt_usec; } return rtt; |