(0002468)
|
kubrick
|
2007-11-29 11:16
(edited on: 2007-11-29 11:17) |
|
In src/UploadBandwidthThrottler.cpp, for each packet sent, we have a minimum sleep time of 1ms because of :
const uint32 TIME_BETWEEN_UPLOAD_LOOPS = 1;
[...]
uint32 extraSleepTime = TIME_BETWEEN_UPLOAD_LOOPS;
[...]
uint32 sleepTime;
if(allowedDataRate == 0 || allowedDataRate == _UI32_MAX || realBytesToSpend >= 1000) {
// we could send at once, but sleep a while to not suck up all cpu
sleepTime = extraSleepTime;
} else {
// sleep for just as long as we need to get back to having one byte to send
sleepTime = std::max((uint32)ceil((double)(-realBytesToSpend + 1000)/allowedDataRate), extraSleepTime);
}
So we can only send a maximum of 1000 packets each second. 1 packet weighing about 1,5kB, the max upload rate should be 1,5MB/s. This is exactly what I am having. So I guess the problem must be here.
Am I wrong?
modifié le : 11-29-07 11:17 |
|