forked from premiere/premiere-libtorrent
add send_buffer_low_watermark in an attempt to improve seed ramp-up time
This commit is contained in:
parent
02b0e0ead3
commit
9bd40e950b
|
@ -49,6 +49,7 @@ void bind_session_settings()
|
||||||
#endif
|
#endif
|
||||||
.def_readwrite("free_torrent_hashes", &session_settings::free_torrent_hashes)
|
.def_readwrite("free_torrent_hashes", &session_settings::free_torrent_hashes)
|
||||||
.def_readwrite("upnp_ignore_nonrouters", &session_settings::upnp_ignore_nonrouters)
|
.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)
|
.def_readwrite("send_buffer_watermark", &session_settings::send_buffer_watermark)
|
||||||
#ifndef TORRENT_NO_DEPRECATE
|
#ifndef TORRENT_NO_DEPRECATE
|
||||||
.def_readwrite("auto_upload_slots", &session_settings::auto_upload_slots)
|
.def_readwrite("auto_upload_slots", &session_settings::auto_upload_slots)
|
||||||
|
|
|
@ -136,6 +136,7 @@ namespace libtorrent
|
||||||
#endif
|
#endif
|
||||||
, free_torrent_hashes(true)
|
, free_torrent_hashes(true)
|
||||||
, upnp_ignore_nonrouters(false)
|
, upnp_ignore_nonrouters(false)
|
||||||
|
, send_buffer_low_watermark(512)
|
||||||
, send_buffer_watermark(500 * 1024)
|
, send_buffer_watermark(500 * 1024)
|
||||||
, send_buffer_watermark_factor(50)
|
, send_buffer_watermark_factor(50)
|
||||||
#ifndef TORRENT_NO_DEPRECATE
|
#ifndef TORRENT_NO_DEPRECATE
|
||||||
|
@ -476,6 +477,14 @@ namespace libtorrent
|
||||||
// our currently configured router.
|
// our currently configured router.
|
||||||
bool upnp_ignore_nonrouters;
|
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
|
// if the send buffer has fewer bytes than this, we'll
|
||||||
// read another 16kB block onto it. If set too small,
|
// read another 16kB block onto it. If set too small,
|
||||||
// upload rate capacity will suffer. If set too high,
|
// upload rate capacity will suffer. If set too high,
|
||||||
|
|
|
@ -4525,7 +4525,10 @@ namespace libtorrent
|
||||||
int buffer_size_watermark = upload_rate
|
int buffer_size_watermark = upload_rate
|
||||||
* m_ses.settings().send_buffer_watermark_factor / 100;
|
* 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)
|
else if (buffer_size_watermark > m_ses.settings().send_buffer_watermark)
|
||||||
{
|
{
|
||||||
buffer_size_watermark = m_ses.settings().send_buffer_watermark;
|
buffer_size_watermark = m_ses.settings().send_buffer_watermark;
|
||||||
|
|
|
@ -274,13 +274,17 @@ namespace libtorrent
|
||||||
// the bandwidth delay product. Assuming an RTT
|
// the bandwidth delay product. Assuming an RTT
|
||||||
// of 500 ms, and a send rate of 20 MB/s, the upper
|
// of 500 ms, and a send rate of 20 MB/s, the upper
|
||||||
// limit should be 10 MB
|
// 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
|
// put 1.5 seconds worth of data in the send buffer
|
||||||
// this gives the disk I/O more heads-up on disk
|
// this gives the disk I/O more heads-up on disk
|
||||||
// reads, and can maximize throughput
|
// reads, and can maximize throughput
|
||||||
set.send_buffer_watermark_factor = 150;
|
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
|
// don't retry peers if they fail once. Let them
|
||||||
// connect to us if they want to
|
// connect to us if they want to
|
||||||
set.max_failcount = 1;
|
set.max_failcount = 1;
|
||||||
|
|
|
@ -320,6 +320,7 @@ namespace aux {
|
||||||
#endif
|
#endif
|
||||||
TORRENT_SETTING(boolean, free_torrent_hashes)
|
TORRENT_SETTING(boolean, free_torrent_hashes)
|
||||||
TORRENT_SETTING(boolean, upnp_ignore_nonrouters)
|
TORRENT_SETTING(boolean, upnp_ignore_nonrouters)
|
||||||
|
TORRENT_SETTING(integer, send_buffer_low_watermark)
|
||||||
TORRENT_SETTING(integer, send_buffer_watermark)
|
TORRENT_SETTING(integer, send_buffer_watermark)
|
||||||
#ifndef TORRENT_NO_DEPRECATE
|
#ifndef TORRENT_NO_DEPRECATE
|
||||||
TORRENT_SETTING(boolean, auto_upload_slots)
|
TORRENT_SETTING(boolean, auto_upload_slots)
|
||||||
|
|
Loading…
Reference in New Issue