-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improved downloader webseed performance (#10715)
This contains fixes, mainly in erigontech/torrent which improve the parallelization of the lib to support downloads speeds over ~25MB per second on a reliable basis. `--torrent.download.rate=256mb --torrent.download.slots=32` should now run a download to completion at a consistent ~250MB/second download rate, assuming `64GB` of available memory. If more memory is available `--torrent.download.rate=512mb --torrent.download.slots=48` will around ~400MB/second. Its not yet clear where the loss in performance is but for this version ofthe code it seems 400MB/second is around the maximum it can support. # Outstanding Issues The current version of the code is memory hungry at high bandwidths the reason behind this is the way the http data is dealt with under high load. The buffer model is currently: `http->hashing->mmap` Where both the http connection and the torrent hasher will retain intermediate buffers until they are finally flushed to te memory mapped file. A more memory efficient model would be to get the http connection to write directly to the memory mapped segment which can the be directly hashed. This will require further code modification - which is outside of the scope of this change. # Downloader changes Along with the torrent lib changes a number of changes have been made to the downloader code. The most significant are: * d.webseeds.DownloadAndSaveTorrentFile has been added to the post processing step after webseed torrents are downloaded. This is becuase it appears that if this is not done certian scenarios will lead to a torrrent's metadata never becoming availible. (If the existing checks are made before the download is finished) * `mdbxPieceCompletion` now has a `Flushed(infoHash infohash.T, flushed *roaring.Bitmap)` method which is used to commit the completion status to the db after an asynchronous flush of the mmap files has been made. This means that the completion state will only be confirmed once the data is flushed. (This may lead to re-downloading of peices in the case of a crash. --------- Co-authored-by: alex.sharov <AskAlexSharov@gmail.com>
- Loading branch information
1 parent
4e2b026
commit 1b060dd
Showing
9 changed files
with
147 additions
and
129 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.