Opened 12 years ago
Last modified 14 months ago
#2257 new patch
[lt.sess_set.active_*] Allow setting of active_dht_limit, active_tracker_limit and active_lsd_limit. Fix bugs.
Reported by: | Chionsas | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | 2.x |
Component: | Core | Version: | 1.3-stable |
Keywords: | Cc: | mvseqt2twu@snkmail.com |
Description
Problem: Deluge does not send announcements to trackers or dht/lsd when default torrent count limits for those nodes in libtorrent are reached.
From libtorrent's API:
active_limit is a hard limit on the number of active torrents. This applies even to slow torrents. active_dht_limit is the max number of torrents to announce to the DHT. By default this is set to 88, which is no more than one DHT announce every 10 seconds. active_tracker_limit is the max number of torrents to announce to their trackers. By default this is 360, which is no more than one announce every 5 seconds. active_lsd_limit is the max number of torrents to announce to the local network over the local service discovery protocol. By default this is 80, which is no more than one announce every 5 seconds (assuming the default announce interval of 5 minutes).
You can have more torrents active, even though they are not announced to the DHT, lsd or their tracker. If some peer knows about you for any reason and tries to connect, it will still be accepted, unless the torrent is paused, which means it won't accept any connections.
Bug: Deluge only allows active_limit
to be set. Deluge does not provide any means to control those other limits (active_dht_limit
, active_tracker_limit
, active_lsd_limit
). When there are more than, say 1600 torrents using trackers, some of them get put in the limbo state described in the last paragraph of the quote.
(Latest libtorrent defaults: http://code.google.com/p/libtorrent/source/browse/src/session.cpp#1178. Before 0.16.4 it was less than 1600, according to the changelog. It was 360 sometime ago, as per the API.)
I believe some of the complaints in http://dev.deluge-torrent.org/ticket/1127 are about this and http://forum.deluge-torrent.org/viewtopic.php?f=7&t=42329 forum post is definitely related.
Solution: Allow setting of active_dht_limit
, active_tracker_limit
and active_lsd_limit
, thus overriding libtorrent defaults.
Patch: The patch attached defaults active_dht_limit
, active_tracker_limit
and active_lsd_limit
to -1
(actually, 2147483647
, as libtorrent does not accept -1
. 2147483647
is a max of a 32-bit unsigned int
and in accordance with how libtorrent does it).
The patch does not allow controling these limits via the GUI. I assume controling active_limit
is enough for all uses and if not, the variables can be altered in the .conf file. Some GUI fields to control these variables may be added later.
Testing: works for me (fixes the problem/bug described above). Unsure of any performance drawbacks with frequent lsd/dht announces.
active_limit
controls all the limits now, so the user can always set it to lower. Hidden limits that cannot be changed (as with current version (1.3.5)) are bad either way.
Attachments (2)
Change History (8)
by , 12 years ago
Attachment: | active_X_limit.diff added |
---|
comment:1 by , 12 years ago
It seems that active_dht_limit
, active_tracker_limit
and active_lsd_limit
are new features of libtorrent 0.16. Prior to this version (0.15 and below), only active_limit existed. Thereore, it's not a bug of deluge per se, as deluge oficially only supports libtorrent 0.14 and 0.15.
Furthermore, it's now clear that libtorrent 0.16.0 to 0.16.3 has an active_tracker_limit
of 360 and in versions 0.16.4 to 0.16.6 it's increased to 1600.
The patch attached (default values of -1) effectively removes these new limits, making libtorrent function as it was with before with only active_limit. It is not clear if this has any performance implications. Running it on my own box with 1000+ torrents, no performance issues were observed.
It was talked about in IRC that new code that gazpachoking is working on should expose these new variables to the GUI. So we could use sane values for defaults instead of -1, as the user will be able to change them easily, along with active_limit
.
I'm now attaching a patch for the master branch. The only difference between patches is that the Python code in master does not require to explicitly call register_set_function()
parameter setters. It's all done automatically in do_config_set_func
, which is a good thing :)
by , 12 years ago
Attachment: | support-libtorrent0.16.6-active_X_limit-settings-branch-master.diff added |
---|
no spaces in diff filename
comment:2 by , 12 years ago
Milestone: | 1.3.6 → 1.4.0 |
---|
comment:3 by , 11 years ago
Summary: | Allow setting of active_dht_limit, active_tracker_limit and active_lsd_limit. Fix bugs. → [lt.sess_set.active_*] Allow setting of active_dht_limit, active_tracker_limit and active_lsd_limit. Fix bugs. |
---|
You can use the lt config plugin to change this setting in meantime.
comment:5 by , 6 years ago
Cc: | added |
---|
comment:6 by , 14 months ago
I would suggest just hardcoding '-1' for all three fields and leave unconfigurable, like qbittorrent does currently(they used to set these 3 limits same as active_limit, but changed to fixed '-1'). Ltconfig can then be used to provide more fine-graned control for specific use-cases if needed, as said.
The issue steming from this, is brought up on the forum on a semi-recent basis too.
Thanks!
Allow setting of active_dht_limit, active_tracker_limit and active_lsd_limit.