Skip to content

feature: add support for sequential download #131

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

Merged
merged 7 commits into from
Dec 26, 2020
Merged

Conversation

jesec
Copy link
Owner

@jesec jesec commented Dec 23, 2020

Work in progress

Client:

Drawbacks:

Benefits:

  1. Sequential downloading helps with I/O performance and lowers resource consumption and cost of hardware. It enables predictable I/O patterns and efficient caching. My hard disk is really noisy while downloading a torrent. But with sequential downloading, it does not make a sound. Speed is much better as well. Sequential I/O patterns also eliminate disk fragmentation problem that damages performance/lifespan of hard disks in long-term, which is a headache for long seeders.
  2. "It is bad for swarms." That's correct for unhealthy swarms. However, for private torrent users, in most cases, the seeder/leecher relationship is "many seeder, single/little leecher". Plus, with the incentives/punishments of tracker sites, there is little to no risk of "draining". As such, it makes more sense to protect hardware of everyone in the swarm. Predictable I/O patterns also allow seeders to seed many torrents more efficiently: if leechers use sequential download, the read patterns become predictably sequential, which allows better I/O performance and reduces the failure rate of hard disks.
  3. For seedbox users: seedboxes are virtual machines. That means many users share the same physical machine. Random chunk downloading is extremely taxing on disks. As a result, usually the speeds are limited by I/O more than bandwidth. If the swarm pattern is usually "many seeder, single leecher", sequential downloading can help a lot.
  4. Widely known "self" benefits: stream early, stream while downloading, organize episodes quick and unpack some files before finish, etc.

@jesec jesec added the enhancement New feature or request label Dec 23, 2020
@jesec jesec added this to the 4.4 milestone Dec 23, 2020
@jesec jesec force-pushed the feature/sequential branch from cf4de58 to 793a840 Compare December 24, 2020 04:56
@codecov
Copy link

codecov bot commented Dec 24, 2020

Codecov Report

Merging #131 (a12192a) into master (038ee3f) will decrease coverage by 0.36%.
The diff coverage is 67.52%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #131      +/-   ##
==========================================
- Coverage   82.11%   81.75%   -0.37%     
==========================================
  Files          55       55              
  Lines        8371     8539     +168     
  Branches      695      703       +8     
==========================================
+ Hits         6874     6981     +107     
- Misses       1496     1557      +61     
  Partials        1        1              
Impacted Files Coverage Δ
server/services/feedService.ts 66.58% <0.00%> (-0.16%) ⬇️
...erver/services/qBittorrent/clientRequestManager.ts 70.95% <13.33%> (-2.71%) ⬇️
...erver/services/qBittorrent/clientGatewayService.ts 76.04% <48.00%> (-1.74%) ⬇️
...rver/services/Transmission/clientGatewayService.ts 79.14% <50.00%> (-0.36%) ⬇️
server/routes/api/torrents.ts 63.86% <66.66%> (+<0.01%) ⬆️
server/services/rTorrent/clientGatewayService.ts 74.00% <77.57%> (+0.07%) ⬆️
server/services/interfaces/clientGatewayService.ts 97.45% <100.00%> (-1.23%) ⬇️
...Torrent/constants/methodCallConfigs/torrentList.ts 94.80% <100.00%> (+0.13%) ⬆️
server/models/Users.ts 91.91% <0.00%> (-3.04%) ⬇️
server/routes/api/auth.ts 91.15% <0.00%> (-1.61%) ⬇️
... and 8 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 038ee3f...a12192a. Read the comment docs.

@jesec jesec force-pushed the feature/sequential branch from 6c3b9d0 to a12192a Compare December 26, 2020 03:02
@jesec jesec merged commit fe9cd92 into master Dec 26, 2020
@jesec jesec deleted the feature/sequential branch December 26, 2020 03:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant