mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
Changes according to experiments from jolavilette:
- set desiredRate of peers to 10MB/s instead of 1MB/s - maximum number of active chunks per peer is now 20 (that was a serious limiting factor) - ticks that bring no data are not accounted for in the speed estimate anymore. The data is averaged over all ticks since the previous non zero data chunk -> this brings much more stability to sources and removes lots of oscillation. The maximum theoretical speed per source peer is therefore 13MB/s (in "Average" DL mode), whereas previously it was 1.3MB/s git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6897 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
3f09bdb0b7
commit
9c4c5da73d
@ -77,8 +77,8 @@ static const int32_t TIMOUT_CACHE_FILE_TRANSFER = 800 ; // time after which cac
|
||||
static const int32_t FT_FILECONTROL_QUEUE_ADD_END = 0 ;
|
||||
static const int32_t FT_FILECONTROL_QUEUE_ADD_AFTER_CACHE = 1 ;
|
||||
|
||||
const uint32_t FT_CNTRL_STANDARD_RATE = 1024 * 1024;
|
||||
const uint32_t FT_CNTRL_SLOW_RATE = 10 * 1024;
|
||||
const uint32_t FT_CNTRL_STANDARD_RATE = 10 * 1024 * 1024;
|
||||
const uint32_t FT_CNTRL_SLOW_RATE = 100 * 1024;
|
||||
|
||||
ftFileControl::ftFileControl()
|
||||
:mTransfer(NULL), mCreator(NULL),
|
||||
|
@ -10,7 +10,7 @@
|
||||
******/
|
||||
|
||||
#define CHUNK_MAX_AGE 120
|
||||
#define MAX_FTCHUNKS_PER_PEER 5
|
||||
#define MAX_FTCHUNKS_PER_PEER 20
|
||||
|
||||
/***********************************************************
|
||||
*
|
||||
|
@ -48,11 +48,11 @@
|
||||
*
|
||||
*/
|
||||
|
||||
const double FT_TM_MAX_PEER_RATE = 10 * 1024 * 1024; /* 10MB/s */
|
||||
const double FT_TM_MAX_PEER_RATE = 100 * 1024 * 1024; /* 100MB/s */
|
||||
const uint32_t FT_TM_MAX_RESETS = 5;
|
||||
const uint32_t FT_TM_MINIMUM_CHUNK = 1024; /* ie 1Kb / sec */
|
||||
const uint32_t FT_TM_RESTART_DOWNLOAD = 20; /* 20 seconds */
|
||||
const uint32_t FT_TM_DOWNLOAD_TIMEOUT = 20; /* 10 seconds */
|
||||
const uint32_t FT_TM_DOWNLOAD_TIMEOUT = 10; /* 10 seconds */
|
||||
const uint32_t FT_TM_CRC_MAP_MAX_WAIT_PER_GIG = 20; /* 20 seconds per gigabyte */
|
||||
|
||||
// const double FT_TM_MAX_INCREASE = 1.00;
|
||||
@ -898,8 +898,14 @@ bool ftTransferModule::locked_tickPeerTransfer(peerInfo &info)
|
||||
std::cerr << "locked_tickPeerTransfer() actual rate (before): " << info.actualRate << ", lastTransfers=" << info.lastTransfers << std::endl ;
|
||||
#endif
|
||||
/* update rate */
|
||||
info.actualRate = info.actualRate * 0.75 + 0.25 * info.lastTransfers;
|
||||
info.lastTransfers = 0;
|
||||
std::cerr << mHash<< " - actual rate: " << info.actualRate << " lastTransfers=" << info.lastTransfers << ". AgeReq = " << ageReq << std::endl;
|
||||
|
||||
if(info.lastTransfers > 0 || ageReq > 2)
|
||||
{
|
||||
info.actualRate = info.actualRate * 0.75 + 0.25 * info.lastTransfers / (float)ageReq;
|
||||
info.lastTransfers = 0;
|
||||
info.lastTS = ts;
|
||||
}
|
||||
|
||||
/****************
|
||||
* NOTE: If we continually increase the request rate thus: ...
|
||||
@ -971,8 +977,6 @@ bool ftTransferModule::locked_tickPeerTransfer(peerInfo &info)
|
||||
#endif
|
||||
}
|
||||
|
||||
info.lastTS = ts;
|
||||
|
||||
#ifdef FT_DEBUG
|
||||
std::cerr << "locked_tickPeerTransfer() desired next_req: " << next_req;
|
||||
std::cerr << std::endl;
|
||||
|
Loading…
Reference in New Issue
Block a user