From: Pierre Ossman Date: Thu, 20 Sep 2018 14:35:37 +0000 (+0200) Subject: Estimate higher bandwidth in slow start X-Git-Tag: v1.9.90~81^2~5^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=4f04ebbb57e13b6621dc9b1bc0667a4e5b8cb465;p=tigervnc.git Estimate higher bandwidth in slow start If we are still in slow start then we haven't discovered the actual bandwidth limit yet. We also rely on the caller causing a bit of congestion to detect the limit. So report a higher bandwidth estimate than what we've currently tested in this scenario. --- diff --git a/common/rfb/Congestion.cxx b/common/rfb/Congestion.cxx index 8162808b..4a784522 100644 --- a/common/rfb/Congestion.cxx +++ b/common/rfb/Congestion.cxx @@ -291,11 +291,20 @@ int Congestion::getUncongestedETA() size_t Congestion::getBandwidth() { + size_t bandwidth; + // No measurements yet? Guess RTT of 60 ms if (safeBaseRTT == (unsigned)-1) - return congWindow * 1000 / 60; + bandwidth = congWindow * 1000 / 60; + else + bandwidth = congWindow * 1000 / safeBaseRTT; + + // We're still probing so guess actual bandwidth is halfway between + // the current guess and the next one (slow start doubles each time) + if (inSlowStart) + bandwidth = bandwidth + bandwidth / 2; - return congWindow * 1000 / safeBaseRTT; + return bandwidth; } void Congestion::debugTrace(const char* filename, int fd)