1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-02-22 22:20:39 +00:00

(trunk libT) lessen evbuffer memory bloat when we have a lot of simultaneous peers

This commit is contained in:
Charles Kerr 2009-06-03 22:52:08 +00:00
parent b6f3b15f0a
commit 8fa568d20b

View file

@ -640,8 +640,8 @@ getDesiredOutputBufferSize( const tr_peerIo * io, uint64_t now )
* It's okay to tweak this as needed */
const double maxBlockSize = 16 * 1024; /* 16 KiB is from BT spec */
const double currentSpeed = tr_bandwidthGetPieceSpeed( &io->bandwidth, now, TR_UP );
const double period = 20; /* arbitrary */
const double numBlocks = 5.5; /* the 5 is arbitrary; the .5 is to leave room for messages */
const double period = 15; /* arbitrary */
const double numBlocks = 3.5; /* the 3 is arbitrary; the .5 is to leave room for messages */
return MAX( maxBlockSize*numBlocks, currentSpeed*1024*period );
}