Bugzilla – Bug 2293
Red Queue Estimator spins when trying to compute queue average size under long idle times
Last modified: 2016-02-11 15:40:52 UTC
This is a performance bug. I have an experiment where I'm using Red Queues for web downloads. In the experiment I have idle times between resource downloads on the order of seconds. If I crank up the link rates and reduce the latency, the Estimator in the Red Queue spins for a long time trying to compute the average queue size during the idle time. Here is the patch, instead of using a while loop, use the pow function: --- a/src/network/utils/red-queue.cc Fri Feb 05 01:35:39 2016 +0000 +++ b/src/network/utils/red-queue.cc Wed Feb 10 13:07:15 2016 +0000 @@ -421,14 +421,8 @@ RedQueue::Estimator (uint32_t nQueued, uint32_t m, double qAvg, double qW) { NS_LOG_FUNCTION (this << nQueued << m << qAvg << qW); - double newAve; - - newAve = qAvg; - while (--m >= 1) - { - newAve *= 1.0 - qW; - } - newAve *= 1.0 - qW; + double newAve = qAvg * pow(1.0-qW, m); + newAve += qW * nQueued; // implement adaptive RED
I agree with Salameh. The patch works fine. Just tested it. - Mohit
Fixed - Worksforme means that the actual code shouldn't be changed.
Thank you. FIXED!
Pushed in changeset: 11876:f9a8116577d5