Do not create Files before downloading them

Get help with all aspects of SABnzbd
Forum rules
Help us help you:
  • Are you using the latest stable version of SABnzbd? Downloads page.
  • Tell us what system you run SABnzbd on.
  • Adhere to the forum rules.
  • Do you experience problems during downloading?
    Check your connection in Status and Interface settings window.
    Use Test Server in Config > Servers.
    We will probably ask you to do a test using only basic settings.
  • Do you experience problems during repair or unpacking?
    Enable +Debug logging in the Status and Interface settings window and share the relevant parts of the log here using [ code ] sections.
Post Reply
T3rr0rZw3rg
Newbie
Newbie
Posts: 4
Joined: January 22nd, 2024, 5:16 am

Do not create Files before downloading them

Post by T3rr0rZw3rg »

Hey Guys,

is it possible that sabnzb does not created the files it's supposed to download before it actually starts downloading them or it directy reserves the space which will be required from the start (which isn't a solution I'd love, but I could accept ;-) )?
Right now it creates a file with ~650KB for every file it's going to download as soon the NZB is added (even if the final file size will be . This unfortunately messes with my server setup if multiple files are created before writing significant data into it.

Thank you in advance,
T3rr0rZw3rg
User avatar
safihre
Administrator
Administrator
Posts: 5366
Joined: April 30th, 2015, 7:35 am
Contact:

Re: Do not create Files before downloading them

Post by safihre »

That's unfortunately not possible.
We do this because nowadays there's so much obfuscation going on that in order to be able to extract things, either using Direct Unpack or afterwards, we need the first few bytes of each file to check them against the par2 file.
Without that, Direct Unpack wouldn't work since the names of the files are often obfuscated.
So we download the first articles of each file first and then use those to determine the actually correct filename before writing to disk. We could keep the first articles in memory, but that could easily become a lot of data (650KB x 100 articles is 65MB). So we prefer to just write them to disk right away.

Why does your setup not handle this well? It's basic file operations, nothing too exotic.
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
T3rr0rZw3rg
Newbie
Newbie
Posts: 4
Joined: January 22nd, 2024, 5:16 am

Re: Do not create Files before downloading them

Post by T3rr0rZw3rg »

I've got an small cache drive (<100GB), which deals with fast file transfers, if there is a file written to this drive, is there at least x GB of free space, and if so it will write this file onto the SSD. Otherwise it will write it to an HDD, this isn't transparent for any application using this filesystem (for reference, the OS is called Unraid).
So, I write the rar files there and then extract them onto a HDD, delete the rar files so that I don't have to read and write from my HDD at the same time. Now the issue is, I download something with e.g. 150GB, sabnzbd will write all the small files into my cache drive and use 65MB (100 X 650KB), however as the download progresses the files grow. But since the system only checks for filesize at generation time it will just keep writing them to the cache until it's full since it obviously can not move files which are beeing written to. Also it can not know which files will be written to in the future and which files are being done beeing written to so it's not save to move them.
There is a process in place to move files from cache to the HDD (aka Array) but this process is usually beeing called when there is low load on the server (usually at night).

So for me it would be great to have the option to write the 650KB * n Articles to the RAM. I rarely download more than 500 Articles at once and I've got sufficient RAM to deal with 500MB extra RAM required because I'm downloading something. For me the best solution would be generating the temporary files in /tmp or somewhere else in the RAM and then moving them from RAM to the drive as soon the file will come up as the next (or within couple next, e.g. always move a batch of 1-10 files) downloads. That way my Filesystem will notice that the cache is close to full and start writing the files onto the HDD instead of the cache.
User avatar
safihre
Administrator
Administrator
Posts: 5366
Joined: April 30th, 2015, 7:35 am
Contact:

Re: Do not create Files before downloading them

Post by safihre »

Unfortunately your setup is too exotic to implement a special configuration for. Sorry!
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
Post Reply