Skip to content
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

Prevent starting new download when disk space is insufficient #10645

Open
emanruse opened this issue May 14, 2019 · 17 comments
Open

Prevent starting new download when disk space is insufficient #10645

emanruse opened this issue May 14, 2019 · 17 comments

Comments

@emanruse
Copy link

emanruse commented May 14, 2019

Background

I often queue a lot of torrents to download for the night on a tmpfs (a Linux system with lots of RAM) as these are torrents I don't need to store long-term, just to review them quickly in the morning (and there is no need to wear the disk for all that). However in the morning I often see the tmpfs partition is full (in KDE Plasma Dolphin even claims the files occupy more space than the actual size of the partition) and the download speed is 0. The end result is: very few (or none) of the torrents have actually completed, although there are enough seeders and many of the files would surely fit on the partition. So unless I monitor/handle manually this process, I can't seem to really have a sequential queue of automatically completing torrents.

My settings are:

Maximum active downloads = 2
Download rate threshold = 50 KiB/s
Upload rate threshold = 50 KiB/s
Torrent inactivity timer = 20 sec

Currently (4.1.6) can't seem to find a way to tell QBT to NOT start (pre-allocate) next torrent files if there is insufficient space on the target partition. It would be really useful to have such option.

@iheartcsharp
Copy link

This should apply whether you you pre-allocate torrents or not. Maybe there can be a setting that says if free space is less than X amount do not start any torrents. Create a new status like "Waiting". Also if you don't preallocate it should auto-pause torrents that are downloading.

@emanruse
Copy link
Author

emanruse commented May 15, 2019 via email

@JakubKoralewski
Copy link

JakubKoralewski commented Feb 23, 2020

@emanruse

Seems much easier to simply have the requested option available only with full torrent pre-allocation enabled.

Why restrict that? Pre-allocation is currently broken (see #6195). I don't see a reason why this option only be available when pre-allocation is checked. Finished torrents will free up space when they are moved to another drive not only when they are pre-allocated, but also when downloading normally.

@FranciscoPombal FranciscoPombal changed the title [feature request] Prevent starting new download when disk space is insufficient Prevent starting new download when disk space is insufficient Feb 24, 2020
@dantebarba
Copy link

Is this possible to achieve by just using qbt API?.

  1. Check "Downloading" torrents
  2. If total_torrent_size > size_limit then
    2.1. queue the smallest torrent / queue the biggest torrent and retry (the solution to this issue is not trivial, same as allocating pages in memory, starvation could be an issue).
  3. else, continue downloading.

Don't know if the api has all those parameters, but yeah torrent size + torrent status I think are already available.

@Rojikku
Copy link

Rojikku commented Feb 23, 2022

It's been two years and this would still be great.

@joeblack2k
Copy link

wen disk space.. :(

@MrOscarvs
Copy link

It's been two years and this would still be great.

three years actually....

@Extremity
Copy link

Just woke up to my computer freaking out because for some reason 200 new things were uploaded last night. DL cache drive was completely full.

Every other client I use has a "leave minimum space available" or "don't download if available space <" option. Don't see why we can't here.

@zsugabubus007
Copy link

It's been two years and this would still be great.

three years actually....

Three and a half now and it still would be an awesome feature!

@eeyou
Copy link

eeyou commented Jul 22, 2023

Over 4 years old and I'd be very happy to have this feature right now to help me tame down QB 😦

@ghost
Copy link

ghost commented Sep 28, 2023

Came across this. Can't believe there's not a solution. Made a solution:

python script

Basically it assumes you start all torrents as paused w/ metadata downloaded, and it'll go resume all the ones with enough disk space to finish. I run it via a cronjob. Simple, but works for my purposes, hopefully will for others.

@Greatdane
Copy link

Would love this to be an option, still routing for it as a feature request! Just had my Unraid docker's die because the cache drive got full due to an unusual torrent. With all the advanced options in qbt, I am surprised this is not one yet!

@Extremity
Copy link

Extremity commented Oct 11, 2023

This is so stupid simple:

  1. Add the following option, with two sub-inputs:

--- Require minimum available space to download:
-------- [ ] DL Destination Drive: [ 0.000 ] (GB)
-------- [ ] DL Temporary Drive: [ 0.000 ] (GB)

...where there's an option header, followed by the two sub-headings preceded by checkboxes (to enable either or, or both) and followed by a numeric input field followed by a selectable containing KB, MB, GB, TB.

  1. The logistics of it are also stupid simple. On any torrent addition, if an option is enabled, check remaining disk space for the assigned location related to the option(s) selected. If there is not enough space, simply continue to add the file but do so as inactive/paused/whatever. Bonus points if a new error type can be added to show it did not start due to "Insufficient destination/temporary disk space (user defined)."

  2. Bonus options which would be appreciated but are absolutely not required - Auto resume any halted downloads (specifically only if halted due to space check) if available space increases and exceeds limit, notification option for when a download is halted due to hitting the limit.

Ignoring the bonus options - which again are just a nicety, not a requirement, this is beyond simple. Check if option is set when adding torrent. If so, check for assigned path related to which setting is enabled, or both. Check disk space of path. If < assigned limit, halt. Done. If this happens on a manual addition rather than an automated/RSS addition, simply prompt the user and allow them to continue anyways if they wish.

Checking available disk space is not only crazy easy to do but you're already interfacing with the filesystem all over the place, so you KNOW it's easy to do. I don't get it, this is a fifteen minute (if that) fix, why the hesitation? Does one of us need to do it ourselves? I feel like me cobbling it together with no other experience working on torrent clients is not the best solution, but hell, if it's not going to be done otherwise I'll take a shot at it.

@ShadabFaiz
Copy link

This is still not possible to do?

@Extremity
Copy link

Of course it's possible, and other clients have the option.

@glassez
Copy link
Member

glassez commented Apr 29, 2024

Does one of us need to do it ourselves?

Who exactly do you mean by "one of us"? If it's "one of qBittorrent community", then yes, one of us need do it - someone who has the desire and opportunity to do it. There is no such person yet.

@stephenshutters
Copy link

Gosh, this feature is essential.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests