qbittorrent / qBittorrent

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

Alternate connections per torrent while seeding. #2193

Open Nemo-qB opened 9 years ago

Nemo-qB commented 9 years ago

Hi,

I've talked with sledge about this also and here is the ticket for it.

qBittorrent has a setting to set the max connections per torrent which is good, but having the seeding torrents also make that amount of connections seems a bit high especially if you have downloading torrents still active. So to save some bandwith the number of connections for seeding torrents could be managed seperatly.

What we have right now: Max number of connections per torrent default is the maximum number of peers to which you can be connected on a torrent per default. Sets the default number of seed and peer connections each torrent can have.

Good, but I think it can be improved. Especially when you have seeding torrents active while downloading. I've found something interesting in Vuze that would work great with qBittorrent also. Its called ''Alternate default when seeding''.

The wiki says this: Alternate default when seeding defines the default value if there are only uploading torrents.

c6r2ibk

The downloading torrents will honor the first option, while the seeding torrents will be configurable by the second option. So if you have 125 connections per torrent the downloading ones will use this setting, if you have set 25 at seeding alternate then all the seeding torrents will be limited at 25 connections instead all going to 125. For example having 50+ or more torrents and all reaching to 80-125 connections isn't healthy either.

Examples:

Current situation. Seeding torrent 1: 125 connections Seeding torrent 2: 125 connections Seeding torrent 3: 125 connections Downloading torrent 4: 125 connections

Total: 500 connections (lets pretend that all torrents are very active).

In this situation all torrents will be using 125 connections max and in total 500 connections.

New situation. Seeding torrent 1: 25 connections Seeding torrent 2: 25 connections Seeding torrent 3: 25 connections Downloading torrent 4: 125 connections

Total: 200 connections. (if the new setting would be there and enabled).

In this new situation the seeding torrents will be limited at 25 connections max to save bandwith for the downloading torrent(s). The downloading torrent will still be using 125 connections as set.

If the connections limit is set to for example 125 and max upload slots to 4 then qBittorrent connects to all the peers that there are available and reaching 80-125 connections. What you get is that 4-5 peers are getting uploaded to and other 100-110 peers are just idling.

I hope im clear, I can post screenshots how qBittorrent behaves tomorrow if needed (or you can test it yourself).

Regards, Nemo.

Seeker2 commented 8 years ago

It would be nice if not only this was added but it was enabled by default for new installs of qBitTorrent...and set to only 10 connections for seeding torrents.

Optimistic unchoke upload slot handling is simply not good enough to deal with more than a tiny handful of "excess" peers beyond the normal upload slot max.

Seeker2 commented 7 years ago

Is the holdup here that there's no setting/s in libtorrent that can do this?

...And so this would possibly have to be worked into qBT's torrent automatic mode?

Seeker2 commented 5 years ago

Further increasing the usefulness and urgency of adding this: Increasing connections per torrent slows down all torrents https://github.com/qbittorrent/qBittorrent/issues/11261

The workaround of setting global max connections to 2000 (highest qBitTorrent seems to allow!) is sub-optimal for everyone to do!

ghost commented 4 years ago

If I understand correctly, this would require some changes in libtorrent. You’d have to separate the unchoke slot settings for seeding and downloading torrents and then you can have separate configurable options for them in qBt. @arvidn any thoughts?

arvidn commented 4 years ago

The choking algorithm in libtorrent operates on all peers in a session. Do I understand correctly that this feature request is to configure the number of unchoke slots per torrent, and running the choking algorithm per torrent?

Seeker2 commented 4 years ago

No, this feature request does nothing to the choking algorithm OR the number of unchoke upload slots per torrent.

It is only to allow max connections for seeding torrents be something different than downloading torrents. Max connections for seeding torrents should be considerably lower -- as seeds do not stay connected to other seeds and don't Tit-For-Tat.

The need for this feature is 2-fold:

  1. To reduce the number of connections when seeding lots of torrents, as already mentioned by the initial poster of this issue. This should hopefully decrease qBT's ram, cpu, and bandwidth usage.

  2. A default of 50 max connections per torrent and 4 max upload slots for busy seeding torrents will often result in 30+ connected peers that receive nothing from the seed even if they remain connected for hours. Better to not tie up a connection to a seed if the seed is unable or unwilling to seed!

arvidn commented 4 years ago

I see. libtorrent supports this by torrent_handle::set_max_connections() ([docs](https://libtorrent.org/reference-Core.html#set_max_connections()))

Seeker2 commented 4 years ago

Does that set every running torrent to the same max value?

ghost commented 4 years ago

Does that set every running torrent to the same max value?

No. It sets the maximum number of connection limit for specific torrents. Read the docs.

Seeker2 commented 4 years ago

The docs implies set_max_connections() sets the max connection limit for torrents and connections_limit sets the max connection limit globally.

So this feature request should be doable without a libtorrent extension.

Seeker2 commented 3 years ago

@FranciscoPombal Does that mean it will soon be added to a more recent build?

FranciscoPombal commented 3 years ago

@Seeker2 The old milestone removal? It doesn't mean anything, it's just that it did not make sense for this ticket to be attached to that milestone any longer.

Nemo-qB commented 2 years ago

After almost 8 years (time flies..) I was wondering if this is still considered to be added or it has became obsolete?

I have been using and experimenting BiglyBT (replaced Vuze) now and then together with OpenJDK just for this feature especially with torrents that have hundreds of peers active, to get things clear again;

This feature could maybe also be implented into the torrent options window when right clicking the torrent and setting a connections limit yourself. If so when the torrent is complete I can change the connections limt for that certain torrent manually to lets say 25 (and stay like that, being saved till it gets changed eventually). This way the other torrents will still keep following the default value. The thing is that this has to be done for each completed torrent while if there is a setting for it then it would be done automaticly.

dfhdfgdf