aMule Bug Tracker - aMule
View Issue Details
0000443aMuleTransferpublic2005-05-19 14:292005-06-14 23:48
eyalzo 
Xaignar 
normalminoralways
closedopen 
SVN 
 
0000443: Upload rate is wrong under heavy load
This bug in minor only because it happens to people with very-very fast network.
When upload speed is very high (1000K+), some sockets are busy (?) and many "sent" bytes actually don't get through.
The problem is where total speed is calculated. It thinks that all bytes are out, and speed is higher than it is in reality, so it reduces the speed (according to the limit).
What I see there is numbers like 8000K when it's supposed to be "only" 1000K.
The fix I tried (and it works) is in CUpDownClient::SendBlockData
See the 3 lines with "bytesSent"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    uint32 bytesSent = 0;
    
    while (!m_BlockSend_queue.IsEmpty()
        && m_BlockSend_queue.GetHead()->GetRealPacketSize() <= m_nMaxSendAllowed){
            
        CPacket* tosend = m_BlockSend_queue.RemoveHead();
        uint32 nBlockSize = tosend->GetRealPacketSize();
        m_nMaxSendAllowed -= nBlockSize;
        SendPacket(tosend,true,false);
        m_nTransferedUp += nBlockSize;
        bytesSent += nBlockSize;
        theApp.statistics->UpdateSentBytes(nBlockSize);
        credits->AddUploaded(nBlockSize, GetIP());
        if (m_BlockSend_queue.IsEmpty())
            CreateNextBlockPackage();
    }
    kBpsUp += kBpsToSend*(1.0-lambdaAvg); // 2nd part of averaging filter
    return bytesSent;
No tags attached.
Issue History
2005-05-19 14:29eyalzoNew Issue
2005-05-19 19:36XaignarNote Added: 0000984
2005-05-20 02:03KryStatusnew => assigned
2005-05-20 02:03KryAssigned To => Xaignar
2005-05-24 08:47eyalzoNote Added: 0000996
2005-06-14 23:48XaignarStatusassigned => closed
2005-06-14 23:48XaignarNote Added: 0001066

Notes
(0000984)
Xaignar   
2005-05-19 19:36   
You've written "CVS" for version, but that cant be. Current CVS uses a completely different upload-scheduling (UBT from eMule) code than what you've pasted. Could you test it with a CVS build and see if the problem is still there?
(0000996)
eyalzo   
2005-05-24 08:47   
I had to choose "CVS" as version because 2.0.1 wasn't on the version list, and 2.0.1 was just released.
So my comment is related to 2.0.1. I won't be able to check CVS now, but I'll do that one day.
Thanks.
(0001066)
Xaignar   
2005-06-14 23:48   
Closing until that "one day" arrives.