add send_buffer_low_watermark in an attempt to improve seed ramp-up time

This commit is contained in:
Arvid Norberg 2012-03-07 02:59:50 +00:00
parent 02b0e0ead3
commit 9bd40e950b
5 changed files with 20 additions and 2 deletions

View File

@ -49,6 +49,7 @@ void bind_session_settings()
#endif
.def_readwrite("free_torrent_hashes", &session_settings::free_torrent_hashes)
.def_readwrite("upnp_ignore_nonrouters", &session_settings::upnp_ignore_nonrouters)
.def_readwrite("send_buffer_low_watermark", &session_settings::send_buffer_low_watermark)
.def_readwrite("send_buffer_watermark", &session_settings::send_buffer_watermark)
#ifndef TORRENT_NO_DEPRECATE
.def_readwrite("auto_upload_slots", &session_settings::auto_upload_slots)

View File

@ -136,6 +136,7 @@ namespace libtorrent
#endif
, free_torrent_hashes(true)
, upnp_ignore_nonrouters(false)
, send_buffer_low_watermark(512)
, send_buffer_watermark(500 * 1024)
, send_buffer_watermark_factor(50)
#ifndef TORRENT_NO_DEPRECATE
@ -476,6 +477,14 @@ namespace libtorrent
// our currently configured router.
bool upnp_ignore_nonrouters;
// This is the minimum send buffer target size (send buffer
// includes bytes pending being read from disk). For good
// and snappy seeding performance, set this fairly high, to
// at least fit a few blocks. This is essentially the initial
// window size which will determine how fast we can ramp up
// the send rate
int send_buffer_low_watermark;
// if the send buffer has fewer bytes than this, we'll
// read another 16kB block onto it. If set too small,
// upload rate capacity will suffer. If set too high,

View File

@ -4525,7 +4525,10 @@ namespace libtorrent
int buffer_size_watermark = upload_rate
* m_ses.settings().send_buffer_watermark_factor / 100;
if (buffer_size_watermark < 512) buffer_size_watermark = 512;
if (buffer_size_watermark < m_ses.settings().send_buffer_low_watermark)
{
buffer_size_watermark = m_ses.settings().send_buffer_low_watermark;
}
else if (buffer_size_watermark > m_ses.settings().send_buffer_watermark)
{
buffer_size_watermark = m_ses.settings().send_buffer_watermark;

View File

@ -274,13 +274,17 @@ namespace libtorrent
// the bandwidth delay product. Assuming an RTT
// of 500 ms, and a send rate of 20 MB/s, the upper
// limit should be 10 MB
set.send_buffer_watermark = 2 * 1024 * 1024;
set.send_buffer_watermark = 3 * 1024 * 1024;
// put 1.5 seconds worth of data in the send buffer
// this gives the disk I/O more heads-up on disk
// reads, and can maximize throughput
set.send_buffer_watermark_factor = 150;
// always stuff at least 1 MiB down each peer
// pipe, to quickly ramp up send rates
set.send_buffer_low_watermark = 1 * 1024 * 1024;
// don't retry peers if they fail once. Let them
// connect to us if they want to
set.max_failcount = 1;

View File

@ -320,6 +320,7 @@ namespace aux {
#endif
TORRENT_SETTING(boolean, free_torrent_hashes)
TORRENT_SETTING(boolean, upnp_ignore_nonrouters)
TORRENT_SETTING(integer, send_buffer_low_watermark)
TORRENT_SETTING(integer, send_buffer_watermark)
#ifndef TORRENT_NO_DEPRECATE
TORRENT_SETTING(boolean, auto_upload_slots)