Opened 11 years ago

Last modified 8 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@…

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)

active_X_limit.diff (2.6 KB) - added by Chionsas 11 years ago.
Allow setting of active_dht_limit, active_tracker_limit and active_lsd_limit.
support-libtorrent0.16.6-active_X_limit-settings-branch-master.diff (1.9 KB) - added by Chionsas 11 years ago.
no spaces in diff filename

Download all attachments as: .zip

Change History (8)

Changed 11 years ago by Chionsas

Allow setting of active_dht_limit, active_tracker_limit and active_lsd_limit.

comment:1 Changed 11 years ago by Chionsas

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 :)

Changed 11 years ago by Chionsas

no spaces in diff filename

comment:2 Changed 11 years ago by Cas

  • Milestone changed from 1.3.6 to 1.4.0

comment:3 Changed 10 years ago by Cas

  • Summary changed from Allow setting of active_dht_limit, active_tracker_limit and active_lsd_limit. Fix bugs. to [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:4 Changed 7 years ago by Cas

  • Milestone changed from 2.0.x to 2.x

Milestone renamed

comment:5 Changed 5 years ago by DoYouWantKarate

  • Cc mvseqt2twu@… added

comment:6 Changed 8 months ago by mhertz

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!

Note: See TracTickets for help on using tickets.