Repository navigation
Disable torrent stats importation at start - #1511
Merged
josecelano merged 1 commit intoMay 9, 2025
Merged
josecelano merged 1 commit into
josecelano merged 1 commit into
Conversation
When the tracker starts, if stats persistence is enabled, all torrents that have ever been downloaded are loaded into memory (`Swarms` type) with their download counter. That's the current way to count all downloads and expose that metric. However, it does not work with **millions of torrents** (like in the tracker demo) becuase: - It's too slow. - It consumes too much memory (all torrents that have ever been downloaded have to be loaded). A new solution is needed to keep that metric, but in the meantime, this disables that feature, producing these effects: - Non-accurate value for downloads when the tracker is restarted. - Increasing indefinitely the number of torrents in memory even if the "remove peerless torrents" policy is enabled (becuase this feature overrides that policy and peerless torrents are kept in memory).
josecelano
force-pushed
the
1510-disable-stats-importation-when-the-trackers-starts
branch
from
May 9, 2025 07:43
52c27bd to
cb487f3
Compare
Member
Author
|
ACK cb487f3 |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #1511 +/- ##
===========================================
+ Coverage 83.85% 83.86% +0.01%
===========================================
Files 257 257
Lines 17946 17945 -1
Branches 17946 17945 -1
===========================================
+ Hits 15049 15050 +1
Misses 2620 2620
+ Partials 277 275 -2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
|
Post-merge note: this pull request requested a review from this account and was closed without one at its final head. A post-merge review will not be done: The code it disabled was removed in #1542, which reworked how download counts are persisted; none of its 7 added lines remain on the default branch. |
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When the tracker starts, if stats persistence is enabled, all torrents that have ever been downloaded are loaded into memory (
Swarmstype) with their download counter.That's the current way to count all downloads and expose that metric.
However, it does not work with millions of torrents (like in the tracker demo) becuase:
A new solution is needed to keep that metric, but in the meantime, this disables that feature, producing these effects: