qbittorrent / qBittorrent

qBittorrent BitTorrent client
https://www.qbittorrent.org
Other
27.17k stars 3.9k forks source link

Torrent queueing doesn't move to next torrent considering settings #10681

Open emanruse opened 5 years ago

emanruse commented 5 years ago

qBittorrent version and Operating System

qBittorrent 4.1.6 openSUSE Leap 15.0

If on linux, libtorrent and Qt version

libtorrent-rasterbar 1.1.13 Qt 5.9.4

What is the problem

Torrent queue does not proceed to next torrent in queue with the following settings:

Max active downloads: 2 Max active uploads: -1 Max active torrents: 8

Do not count slow torrents in these limits:

Download rate threshold: 2048 KiB/s Upload rate threshold: 2048 KiB/s Torrent inactivity timer: 60 sec

What happens is: QBT activates 8 torrents (out of 600+ queued) and none of them is downloading faster than 1.5 MiB/s. Even after many minutes though it does not proceed to next torrent in queue to look for ones faster than 2 MiB/s.

What is the expected behavior

If less than "max active downloads" have been slower than "download rate threshold" for more than "torrent inactivity timer" then set the torrent started earliest to queued and activate the next queued torrent.

Steps to reproduce

  1. Use the settings from above
  2. Wait for "torrent inactivity timer" seconds
thalieht commented 5 years ago

Max active torrents: 8 What happens is: QBT activates 8 torrents

You have all the pieces of the puzzle. FYI -1 = infinite.

emanruse commented 5 years ago

You have all the pieces of the puzzle.

No, that's not the point here. But even that doesn't work as expected because as I am typing this there are only 5 active.

The point is: if the number of "high speed" torrents is insufficient (doesn't match the setting of 2 in my case) QBT doesn't move on to next queued torrent to find faster ones. So 8 torrents 100-200 KiB/s each is surely not what I have set.

FYI -1 = infinite.

Yes, I know. But thanks :)

thalieht commented 5 years ago

then set the torrent started earliest to queued and activate the next queued torrent.

I don't think the "slow torrents" subsystem is ever supposed to enqueue an active torrent, especially if the criteria for it is seniority. Anyway, the whole logic for this is handled by libtorrent, so if you have any suggestions to improve it you should post it there.

/semi-offtopic: I just discovered that "stalled" downloads are counted in Max "active" downloads... can't tell if it's a bug or some misunderstanding. I never noticed until now because i use -1 for Max active torrents.

/offtopic Your "Max active" settings seem sub-optimal: 8 seeding torrents and you won't be able to download.

Seeker2 commented 5 years ago

I had the same misunderstanding.

Max "active" downloads should better be understood as Max started unfinished torrents, of which some may have no peers/seeds and be "stalled".

Something along the lines of "don't count slow torrents" would cover the "stalled" ones, but still need to be set to limit even stalled torrents to maybe 50 extra at once (default value, but user configurable!) to prevent flooding trackers when there's peer/seed connection issues.

emanruse commented 5 years ago

I don't think the "slow torrents" subsystem is ever supposed to enqueue an active torrent, especially if the criteria for it is seniority.

Active and queued are different things, so I don't quite see what you mean by "enqueue an active torrent". Also what do you mean by seniority? The criteria is speed and time.

Anyway, the whole logic for this is handled by libtorrent, so if you have any suggestions to improve it you should post it there.

I don't know how this is handled in the software, so I cannot possibly formulate it and upstream it. I can report only an issue which I observe directly, then experts can handle it however it needs to be handled.

/semi-offtopic: I just discovered that "stalled" downloads are counted in Max "active" downloads... can't tell if it's a bug or some misunderstanding. I never noticed until now because i use -1 for Max active torrents.

But stalled = 0 Kb/s anyway, so it is below the slow limits and should not count.

/offtopic Your "Max active" settings seem sub-optimal: 8 seeding torrents and you won't be able to download.

Unless I manually "Force resume" all seeding torrents (which is what I do to avoid the case you mention).

emanruse commented 5 years ago

I had the same misunderstanding.

Max "active" downloads should better be understood as Max started unfinished torrents, of which some may have no peers/seeds and be "stalled".

What exactly do you mean by misunderstanding please? And why should "active" mean something else? Are you saying that this is not an issue but that the wording of the menus should be corrected to reflect the actual functionality?

Something along the lines of "don't count slow torrents" would cover the "stalled" ones, but still need to be set to limit even stalled torrents to maybe 50 extra at once (default value, but user configurable!) to prevent flooding trackers when there's peer/seed connection issues.

That would work even with current settings if the actual behavior matches the expected one because stalled = 0 KiB/s.

Seeker2 commented 5 years ago

My misunderstanding was qBitTorrent worked like uTorrent and didn't count slow downloads (or slow uploads). A torrent can be started, connected to peers and even seeds, and not downloading or uploading anything from time-to-time due to the peers and seeds having limited upload slots. There's still HAVE messages, tracker updates, Peer EXchange (PEX) if enabled ... which is all network activity on such torrents. "Stalled" implies some or all of that stopped, and that may not be the case.

An upper limit is needed on how many started-but-no-DL/UL torrents qBitTorrent can run at once to reduce other problems. Network problems (typically software firewalls) might allow tracker updates but block connections to peers/seeds.

emanruse commented 5 years ago

An upper limit is needed on how many started-but-no-DL/UL torrents qBitTorrent can run at once to reduce other problems. Network problems (typically software firewalls) might allow tracker updates but block connections to peers/seeds.

OK but that is not the current issue. What you are looking for is a feature request for additional limit, so please open a separate one.

Seeker2 commented 5 years ago

There may already be a hidden limit in libtorrent that does that...but qBitTorrent doesn't set/change that limit in any way, which may be one of the reasons some people encounter stuck torrent queues and stalled torrents.