Opened 14 years ago

Closed 11 years ago

Last modified 6 years ago

#1466 closed patch (Fixed)

Performance warning: Send Buffer Watermark

Reported by: Cameron Tacklind Owned by: Calum
Priority: major Milestone: 2.0.0
Component: Core Version: 1.3.1
Keywords: watermark, send buffer Cc: cameron@tacklind.com, non7top@gmail.com, ancient@whatbox.ca

Description

I just took a look at my log file with debug turned on (trying to make some small improvements of my own) I'm getting a ton of alerts from libtorrent, like 60 every second, all from the same torrent.

[DEBUG   ] 16:26:38 alertmanager:123 performance_alert: <TORRENT_NAME>: performance warning: send buffer watermark too low (upload rate will suffer)

Google only found one other reference to this "bug" here on the forums.

This error is coming directly from libtorrent as there is no alert handler defined for it.

The libtorrent documentation shows the correct solution (increasing read buffer) but I can't figure out where I might add that setting setter to the deluge source. (Just started looking at python/deluge)

libtorrent also claims to have many presets for different types of servers (min memory, high performance seed, ...) which have appropriate default settings. Maybe this is the best place to start and implement a preset picker in the preferences.

So really, this "feature-request" is for more control over the libtorrent session settings to optimize performance, not to clean up debug outputs...

Attachments (2)

send_buffer_fix.patch (1.7 KB ) - added by joshbeck 13 years ago.
0001-fix-send-buffer-watermark-too-low-warnings.patch (2.1 KB ) - added by Tydus 12 years ago.

Download all attachments as: .zip

Change History (16)

comment:1 by Cameron Tacklind, 14 years ago

Cc: cameron@tacklind.com added

comment:2 by Calum, 13 years ago

Component: libtorrentcore
Milestone: Future1.4.0

comment:3 by joshbeck, 13 years ago

I've made a patch off of the latest git master that solves this problem automatically. Whenever there's a performance_alert, it doubles the size of the send buffer. It works well for me. I was able to get up to 900KB/s with it, and the performance_alerts stopped after the buffer grew to 1.6MB.

by joshbeck, 13 years ago

Attachment: send_buffer_fix.patch added

comment:4 by Calum, 13 years ago

Type: feature-requestpatch

comment:5 by Vladimir Berezhnoy, 12 years ago

This patch still applies cleanly to git master. Please commit.

comment:6 by Vladimir Berezhnoy, 12 years ago

Cc: non7top@gmail.com added

comment:7 by andar, 12 years ago

I think this patch should look for the specific alert string "send buffer watermark too low" and only then increase the watermark. The reasoning is that there could be other performance alerts that aren't related to the send buffer watermark.

comment:8 by ancient, 12 years ago

Cc: ancient@whatbox.ca added

comment:9 by Tydus, 12 years ago

This patch is based on joshbeck ones.

Fix typos of that one.
Double the buffer only if the performance warning is about that.
Change cap to 50MB, since it seems the send buffer watermark should be roughly your max upload per second. So 5MB is insufficient for a Gigabit Ethernet.

comment:10 by amain, 11 years ago

Patch applies also nicely (some offsets) to 1.3.3. Flooding is stopped and send buffer change is logged:

[DEBUG   ] 11:47:51 torrentmanager:1099 performance_alert: ...: performance warning: send buffer watermark too low (upload rate will suffer)
[DEBUG   ] 11:47:51 torrentmanager:1107 send_buffer_watermark set to 204800..
[DEBUG   ] 11:47:51 torrentmanager:1099 performance_alert: ...: performance warning: send buffer watermark too low (upload rate will suffer)
[DEBUG   ] 11:47:51 torrentmanager:1107 send_buffer_watermark set to 409600..

Thanks!

comment:11 by Calum, 11 years ago

Owner: set to Calum
Status: newassigned

I have pushed a fix to develop: [ce6abe024758] (It is limited to 3MiB but if a larger size is required the libtorrent plugin in the forum can be used to alter send_buffer_watermark)

I have been unable to test it with an actual performance alert from libtorrent so needs someone to verify it works correctly.

comment:12 by Calum, 11 years ago

Resolution: Fixed
Status: assignedclosed

Finally got an alert to test this and looks to be good.

comment:13 by Calum, 9 years ago

Milestone: 2.0.x2.0

comment:14 by Calum, 6 years ago

Milestone: 2.02.0.0

Milestone renamed

Note: See TracTickets for help on using tickets.