mirror of
https://github.com/transmission/transmission.git
synced 2026-05-08 09:39:08 +01:00
(trunk libT) lessen evbuffer memory bloat when we have a lot of simultaneous peers
This commit is contained in:
@@ -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 );
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user