added performance warning when hitting the send buffer watermark limit

This commit is contained in:
Arvid Norberg 2009-08-17 20:29:09 +00:00
parent 507fc50911
commit 51c38c2e16
4 changed files with 14 additions and 4 deletions

View File

@ -5292,7 +5292,8 @@ upload or download rate performance.
outstanding_disk_buffer_limit_reached,
outstanding_request_limit_reached,
upload_limit_too_low,
download_limit_too_low
download_limit_too_low,
send_buffer_watermark_too_low
};
performance_warning_t warning_code;

View File

@ -212,7 +212,8 @@ namespace libtorrent
outstanding_disk_buffer_limit_reached,
outstanding_request_limit_reached,
upload_limit_too_low,
download_limit_too_low
download_limit_too_low,
send_buffer_watermark_too_low
};
performance_alert(torrent_handle const& h
@ -232,7 +233,8 @@ namespace libtorrent
"max outstanding disk writes reached",
"max outstanding piece requests reached",
"upload limit too low (download rate will suffer)",
"download limit too low (upload rate will suffer)"
"download limit too low (upload rate will suffer)",
"send buffer watermark too low (upload rate will suffer)"
};
return torrent_alert::message() + ": performance warning: "

View File

@ -119,7 +119,7 @@ namespace libtorrent
#endif
, free_torrent_hashes(true)
, upnp_ignore_nonrouters(false)
, send_buffer_watermark(80 * 1024)
, send_buffer_watermark(100 * 1024)
, auto_upload_slots(true)
, auto_upload_slots_rate_based(true)
, use_parole_mode(true)

View File

@ -3658,7 +3658,14 @@ namespace libtorrent
int buffer_size_watermark = int(m_statistics.upload_rate()) / 2;
if (buffer_size_watermark < 512) buffer_size_watermark = 512;
else if (buffer_size_watermark > m_ses.settings().send_buffer_watermark)
{
buffer_size_watermark = m_ses.settings().send_buffer_watermark;
if (t->alerts().should_post<performance_alert>())
{
t->alerts().post_alert(performance_alert(t->get_handle()
, performance_alert::send_buffer_watermark_too_low));
}
}
while (!m_requests.empty()
&& (send_buffer_size() + m_reading_bytes < buffer_size_watermark))