mirror of
https://github.com/transmission/transmission
synced 2024-12-27 01:57:52 +00:00
speed improvements... this is getting me 700 KiB/s (which is near to my speed cap) in the ubuntu torrent test
This commit is contained in:
parent
877e2bb86e
commit
5f2bd1d950
2 changed files with 7 additions and 7 deletions
|
@ -45,11 +45,7 @@ enum
|
||||||
RECONNECT_PERIOD_MSEC = (5 * 1000),
|
RECONNECT_PERIOD_MSEC = (5 * 1000),
|
||||||
|
|
||||||
/* how frequently to refill peers' request lists */
|
/* how frequently to refill peers' request lists */
|
||||||
REFILL_PERIOD_MSEC = 2000,
|
REFILL_PERIOD_MSEC = 1500,
|
||||||
|
|
||||||
/* how many peers to unchoke per-torrent. */
|
|
||||||
/* FIXME: make this user-configurable? */
|
|
||||||
NUM_UNCHOKED_PEERS_PER_TORRENT = 8,
|
|
||||||
|
|
||||||
/* don't change a peer's choke status more often than this */
|
/* don't change a peer's choke status more often than this */
|
||||||
MIN_CHOKE_PERIOD_SEC = 10,
|
MIN_CHOKE_PERIOD_SEC = 10,
|
||||||
|
@ -62,6 +58,10 @@ enum
|
||||||
* with a better idea for managing the connection limits */
|
* with a better idea for managing the connection limits */
|
||||||
MAX_CONNECTED_PEERS_PER_TORRENT = 60,
|
MAX_CONNECTED_PEERS_PER_TORRENT = 60,
|
||||||
|
|
||||||
|
/* how many peers to unchoke per-torrent. */
|
||||||
|
/* FIXME: make this user-configurable? */
|
||||||
|
NUM_UNCHOKED_PEERS_PER_TORRENT = 16, /* arbitrary */
|
||||||
|
|
||||||
/* another arbitrary number */
|
/* another arbitrary number */
|
||||||
MAX_RECONNECTIONS_PER_MINUTE = 60,
|
MAX_RECONNECTIONS_PER_MINUTE = 60,
|
||||||
|
|
||||||
|
@ -1558,7 +1558,7 @@ reconnectPulse( void * vtorrent )
|
||||||
|
|
||||||
/* add some new ones */
|
/* add some new ones */
|
||||||
nAdd = MAX_CONNECTED_PEERS_PER_TORRENT - peerCount;
|
nAdd = MAX_CONNECTED_PEERS_PER_TORRENT - peerCount;
|
||||||
for( i=0; i<nAdd && i<nCandidates && i<MAX_RECONNECTIONS_PER_PULSE; ++i )
|
for( i=0; i<nAdd && i<nCandidates; ++i )
|
||||||
{
|
{
|
||||||
tr_peerMgr * mgr = t->manager;
|
tr_peerMgr * mgr = t->manager;
|
||||||
|
|
||||||
|
|
|
@ -495,7 +495,7 @@ tr_peerMsgsAddRequest( tr_peermsgs * msgs,
|
||||||
if( !tr_bitfieldHas( msgs->info->have, index ) )
|
if( !tr_bitfieldHas( msgs->info->have, index ) )
|
||||||
return TR_ADDREQ_MISSING;
|
return TR_ADDREQ_MISSING;
|
||||||
|
|
||||||
maxSize = MIN( 3 + (int)(tr_rcRate(msgs->info->rateToClient)/10), 100 );
|
maxSize = MIN( 3 + (int)(tr_rcRate(msgs->info->rateToClient)/5), 100 );
|
||||||
if( tr_list_size( msgs->clientAskedFor) >= maxSize )
|
if( tr_list_size( msgs->clientAskedFor) >= maxSize )
|
||||||
return TR_ADDREQ_FULL;
|
return TR_ADDREQ_FULL;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue