-
-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change some settings defaults for better behaviour out of the box #11637
Conversation
These changes are suggestions from my experience with using qBittorrent "in the field". The numerical values, in particular, don't have a bulletproof justification, it's just a ballpark. The idea is to optimize defaults for the common case, where it is understood that "common case" now also includes users with relatively fast connections (50+ megabits to 1 gigabit, my condolences to any Australians or Americans reading this) and machines (with SSDs, and the like). The goal is to do this without raising the minimum requirements to run qBittorrent with several torrents too much (I think the main concern would be memory usage). Of course, as always, users at either extreme end (ultra fast machines and connections, machines dedicated to high speed seeding, racing, or users with very low available memory and other system resources) will need to tune their settings for their specific use case. I would appreciate comments about all of these potential changes, but especially relating to the If it is the former, then at least the value for Additionally, how difficult would it be to detect the number of hardware threads on a system at runtime? I ask this because, like I said in a previous discussion, I think the default value @arvidn I would appreciate guidance, thanks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall I'm a bit curious if updating those memory related tweaks will affect less powerful system / embedded systems such as raspberry pi? I mean I don't want it to crash because the default settings is too high for it.
Yes, that is my main concern as well. I am open to suggestions regarding all of the fixed numerical values relating to memory usage, especially the send buffer stuff. Ultimately, I can remove those kinds of changes from this PR, but I still think the other changes (like AnnounceToAllTrackers) are worth it on their own. |
Personally, I wouldn't like this change. However, if others agree I am not going to block this.
IIRC
Not relevant anymore after my #11592 was merged. For the others, I don't have any particular comment. |
What are your reasons for not liking it? It would be nice to know. In any case, this change can be subject to a vote, it it is all the same to you.
It would make sense to be
Yeah I realized it became irrelevant as well I will rebase this on top of the current master and remove this change. |
Just to make sure you guys are talking about the same thing, the affected setting is for bitorrent port and webui always listen on a fixed port 8080. |
yes, and anyway webui users typically want to change both values. for "regular" GUI-only users, random listening port is better for the reasons outlined above, and the webui port is not important for them. |
55b7bac
to
1ce0a7c
Compare
Rebased and dropped IPv6 setting change due to #11592 |
About my comment for random port: I did some history digging and issue digging. I couldn't find the problem I was remembering. So there's a possibility I misremember this. Also after #10523 it probably isn't a big problem to go full random.
I missed this. Don't we break some kind of universal guideline on good behavior for clients if we enable this by default? |
Does that matter, given that a significant chunk of your userbase seems to expect the behavior that enabling it would provide? |
Yep, my thoughts exactly. |
Queue should be disabled by default. Have seen a lot of users who switched from utorrent/bittorrent and are limited to only seeding 3 torrents at a time by default. Some don’t even understand that the torrents queued for seeding are actually not seeding. |
AnnounceToAllTracker should be left off, but announcing to 1 tracker on all tiers should be on. Quite a few torrents are made with tracker tiers for a reason, and hammering all those trackers by default because of connectivity issues only some people have seems a really poor workaround. I had to clarify working-and-reachable trackers, because many proxies do not work with common udp trackers due to them not supporting UDP packets. |
Agreed. I am in favor of all changes except AnnounceToAllTrackers. |
Upon reading @Seeker2 's post and reading through #11279 one more time, I think I have changed my mind. IMO, the correct fix would be to:
(what @Seeker2 said).
Regarding point 2: The downside is that the current feature of "automatically add the following trackers to new torrents" would probably need an upgrade, to support specifying the tiering of the auto-added trackers. It should be noted that, with the existing code base, no combination of options can bring qbittorrent to full compliance with BEP 12. What's more, BEP 12 is very specific about the announce order in each case, but doesn't specify whether a client should always announce to all trackers in a tier even if the first was successful. |
1ce0a7c
to
b0cdfe9
Compare
@Chocobo1 @sledgehammer999 Should I remove the changes to |
I think you missed one change discussed here: #11637 (comment)
|
👍 |
Use random port should be off. As 4.2 addresses the default port 8999 already. |
Should this one still be included since it's already been done with this merged PR??: #11678 |
Another elephant-in-the-room concerning people having trouble getting torrents working is it's not very apparent why a torrent isn't downloading or uploading. This post: #11320 (comment) |
b0cdfe9
to
300a997
Compare
Addressed everything.
Thanks, done.
Done.
???
Perhaps qBittorrent should add a new state, something like "Tracker Error", to better informed the user. And it also should not fail announces when other clients don't as well. Maybe some kind of timeout is set too low? Anyway, those problems are all out of scope of this PR. |
Seeing some crazy disk I/O when diskcache is set to auto in a 32G system. |
@An0n666 "crazy" good or "crazy" bad? Is the disk cache itself being flushed to swapfile? |
crazy bad. It started reading at 150 MB+ from disk. No download/upload ongoing. |
According to current libtorrent code, auto would set the cache to around 800 MiB on a 32 GiB system. This is probably excessive. You can manually set it to lower. Meanwhile, libtorrent could set auto cache to be |
Most people would not want to waste that much RAM on a torrent client. When people see that much disk I/O or RAM usage they’ll probably switch to some other client instead. Why not keep the default to a low value so everyone is happy? If someone wants to allocate more RAM they could change it from settings. |
I don't think 800 MiB is excessive. If one downloads a torrent, if the whole torrent can fit in the cache you get the best performance. It's not obvious to me that setting the cache to a high value is inherently problematic (apart from the fact that the process will use a lot of anonymous memory, which won't get evicted gracefully under memory pressure). @An0n666 could you provide more details of what is being read from disk? |
I think the disk read maybe unrelated. It could be due to some file check on startup(even though nothing was saying checking). |
agreed. In fact, in the next major release of libtorrent (2.0) the disk cache will use the kernel facility, to make it use as much RAM as the kernel has available to it, and gracefully evict it when the system needs more free RAM. |
This change came about because the vast majority of users have < 32 GiB RAM, and for them the previous fixed disk cache value was sometimes a major performance bottleneck. |
I see. But even on a 16/8 GiB system this would use an amount of RAM which is "significant" to some users. Specially when other alternatives might be using lesser amount of RAM with quite similar performance why would anyone opt to use qBit? Unless someone can prove that using a 500 MiB cache instead of 64 gives a significant performance boost, this will remain up to debate. |
I did not claim that 500 MiB is a better value than 64 MiB. My point is that currently, libtorrent assigns "reasonable" values for users that have 512 MiB RAM and up, with the exception of users with 2 GiB (for these users, auto sets the value to ~68 MiB, which is basically the same as before). Here, "reasonable" means "larger enough than 64 MiB to not be a bottleneck but not so big that users would complain about excessive RAM usage". To quote my table above, extrapolated from the libtorrent code:
It's with 32 GiB and up that the current libtorrent logic starts setting values that are perhaps too big. But like arvid mentioned, all this will be resolved in libtorrent 2.0. Nobody will have to fiddle with setting the amount of cache anymore. Until then, this is a workaround to:
|
On a desktop environment 400 MiB could be unreasonable to many users. I believe the values that are automatically set by libtorrent should be re-calibrated to not go over a pre-set maximum. Like don't set anything beyond 200 MiB for even >8 GiB systems. The user always has the option to configure the cache settings if he's experiencing a bottleneck. Cache related bottlenecks will not happen in every use case. One guy could download a 400 MiB file to his cache but if no one is downloading from him, keeping that data in cache and wasting the memory sounds unreasonable to me. Also downloading to cache will not give any significant speed boost as well if the network is not fast enough. So is it ideal to use a large cache even if someone has a very slow network? |
it seems reasonable to make the "logarithm" extend past 4 GiB. I'm open to suggestions. Here's the current logic: https://github.com/arvidn/libtorrent/blob/d33b0506a0f4cd61860fd54864267c82d3e171e3/src/disk_buffer_pool.cpp#L294 Maybe there should be another tier at 8GiB |
@arvidn
I don't think it makes sense to fine tune too much for more than 32 GiB since: @An0n666 thoughts? |
I think the current method should be kept as is but with the addition of below:
A new tier(s) at 8GiB/16GiB or 32GiB There should probably be a MAX Upper Limit Cap for the manual setting of the disk cache setting too. (Just like the outstanding memory when checking torrents is capped at 1024MiB) Should manual disk cache setting only have a range up to max 1024MiB??
|
If this is the current logic then the above mentioned calculations are not correct. |
@xavier2k6 the table you quoted is what this PR implements. In the comment above yours, I suggested new cache values for systems with large amounts of RAM, which is what we are now talking about. Without this PR, (i. e. in all stable releases of qBittorrent thus far), the cache is set to 64 MiB for everyone. @An0n666 |
The code doesn't do a 8192/40. Check the link. |
I thought the quoted table was what the "auto" option implements currently ie the libtorrent "logarithm"
You are suggesting to lower the cache values though on what the "logarithm" does currently??
BTW - I am a plus 1 for implementing the default of "auto" if it does in fact use the libtorrent "logarithm" |
Revert change introduced in qbittorrent#11637 and also revert the associated follow-up qbittorrent#12000. Reason: arvidn/libtorrent#4335
Revert change introduced in qbittorrent/qBittorrent#11637 and also revert the associated follow-up qbittorrent/qBittorrent#12000. Reason: arvidn/libtorrent#4335
Revert change introduced in qbittorrent#11637 and also revert the associated follow-up qbittorrent#12000. Reason: arvidn/libtorrent#4335
Revert change introduced in #11637 and also revert the associated follow-up #12000. Reason: arvidn/libtorrent#4335
AnnounceToAllTrackers (off->on): not sure why this was off by default. It should improve peer discoverability.The situation this change seeks to improve needs a better and more involved fix overall than this simple default setting toggle.6432 MiB): a4816 MiB increase in memory consumption seems worthwhile for a nice performance boost in most cases.QueueingSystemEnabled (on -> off): this is a big one. Users often don't realize this is on and get confused as to why some torrents get the "Queued" status. By defaulting to off, several simultaneous downloads work out of the box. Users who know they want the queueing system will go look in the settings anyway.Already addressed in Disable Torrent Queue by default #11678SendBufferLowWatermark (10 KiB -> 1600 KiB): According to https://www.libtorrent.org/reference-Settings.html#send_buffer_low_watermark - "For good and snappy seeding performance, set this fairly high, to at least fit a few blocks." 1600 KiB is 100 blocks, which is "fairly high".SendBufferWatermark (500 KiB -> 16384 KiB): According to https://www.libtorrent.org/reference-Settings.html#send_buffer_watermark - "If set too small, upload rate capacity will suffer. If set too high, memory will be wasted." 16384 KiB (16 MiB) seems like a small amount of memory to give up in exchange for better upload capacity out of the box.SendBufferWatermarkFactor (50 -> 110): According to https://www.libtorrent.org/reference-Settings.html#send_buffer_watermark_factor - "For high capacity connections, setting this higher can improve upload performance and disk throughput. Setting it too high may waste RAM and create a bias towards read jobs over write jobs.". 110 is a tentative compromise to improve upload performance and disk throughput while keeping read bias in check.All changes related to default numerical values of send buffer settings required more discussion in its own PR/issue.In short, with UseRandomPort = true; the port number will be assigned by the OS (randomly) which should be an unused port at the time making the API call.
IPv6Enabled (false -> true): IPv6 adoption is increasing more and more. Turning this on by default should increase peer discoverability (because it enables connecting to IPv6-only peers).Dropped due to Rework the listening IP/interface selection code #11592