Using RAM for temp files and RAR extraction

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
thestraycat
Newbie
Newbie
Posts: 10
Joined: May 18th, 2020, 4:39 pm

Using RAM for temp files and RAR extraction

Post by thestraycat »

Hi guys,

New to the forum, so sorry if this is in the wrong place!

I had a question, I use SAB nearly every day for large downloads and have recently noticed that my SSD's are all over their recommended Terrabytes written value because of SAB! lol (300TBW)

I'm lucky to have a server with a lot of RAM (256gb RAM) which i use for many tasks. My question is:

Is it possible to have SABnzBD download and extract to RAM without writing temp files too SSD?

It make sense from a speed perspective and from an SSD wearing perspective but obviously it's not quite as safe in terms of unexpected shutdowns wiping the RAM! And I respect it's an edge case! But thought i'd ask...

Any thoughts or experiences?
User avatar
sander
Release Testers
Release Testers
Posts: 8829
Joined: January 22nd, 2008, 2:22 pm

Re: Using RAM for temp files and RAR extraction

Post by sander »

Yes you can. It's called a RAM Disk or RAM Drive. Set it up at OS level, and point Incomplete to it. EDIT: unrar directs to Complete, so (as your subject) also point Complete to the RAM Drive, and after that do a move with a post processing script

It depends on your OS how to set it up.

See https://en.wikipedia.org/wiki/List_of_R ... e_software

On Linux it's easy:

Code: Select all

sander@witte2004:~$ sudo mkdir /mnt/ramdisk
sander@witte2004:~$ 
sander@witte2004:~$ sudo mount -t tmpfs -o size=2000m tmpfs /mnt/ramdisk
sander@witte2004:~$ ll /mnt/ramdisk/
total 4
drwxrwxrwt 2 root root   40 mei 19 00:29 ./
drwxr-xr-x 3 root root 4096 mei 19 00:29 ../

sander@witte2004:~$ dd if=/dev/zero of=/mnt/ramdisk/test1.img bs=1G count=1 oflag=dsync
1+0 records in
1+0 records out
1073741824 bytes (1,1 GB, 1,0 GiB) copied, 0,892701 s, 1,2 GB/s

sander@witte2004:~$ ll /mnt/ramdisk/
total 1048580
drwxrwxrwt 2 root   root           60 mei 19 00:30 ./
drwxr-xr-x 3 root   root         4096 mei 19 00:29 ../
-rw-rw-r-- 1 sander sander 1073741824 mei 19 00:30 test1.img
sander@witte2004:~$ 

So ... writing speed is 1.2 GB/s ... nice ................
thestraycat
Newbie
Newbie
Posts: 10
Joined: May 18th, 2020, 4:39 pm

Re: Using RAM for temp files and RAR extraction

Post by thestraycat »

That's what i thought. Has anyone successsfully done it for SAB? I didnt know if there was a tunable in app to do it tbh.
User avatar
sander
Release Testers
Release Testers
Posts: 8829
Joined: January 22nd, 2008, 2:22 pm

Re: Using RAM for temp files and RAR extraction

Post by sander »

thestraycat wrote: May 18th, 2020, 5:30 pm That's what i thought. Has anyone successsfully done it for SAB? I didnt know if there was a tunable in app to do it tbh.
Which OS ... ?

And as most people have 4 or 16GB, a ramdisk is limited, and bigger downloads will go wrong.
thestraycat
Newbie
Newbie
Posts: 10
Joined: May 18th, 2020, 4:39 pm

Re: Using RAM for temp files and RAR extraction

Post by thestraycat »

Linux (slackware based i believe.) Yeah, as mentioned i understand it's an edge case. Just looking to see if anyone has done it successfully tbh.
User avatar
sander
Release Testers
Release Testers
Posts: 8829
Joined: January 22nd, 2008, 2:22 pm

Re: Using RAM for temp files and RAR extraction

Post by sander »

It took me one minute to setup a Ram Drive on Linux (see above), so easy to try yourself?

Or give me an account on your system, and I'll do it for you! ;-)
thestraycat
Newbie
Newbie
Posts: 10
Joined: May 18th, 2020, 4:39 pm

Re: Using RAM for temp files and RAR extraction

Post by thestraycat »

lol. It's ok i can do it, i've done plenty of RAM cache testing before for nginx static file caching... I do a similar thing for plex for transcodes. But thought there might have been a tunable in the specials menu or someone might have said "Dont do it. it dosn't work, large downloads in RAM corrupt and fail for reasons x,y and z." If it's a matter of no one really does it, there's no testimonials, i'll take a look.
User avatar
sander
Release Testers
Release Testers
Posts: 8829
Joined: January 22nd, 2008, 2:22 pm

Re: Using RAM for temp files and RAR extraction

Post by sander »

FWIW: I did a 1GB download, and Linux' System Monitor tells me:

SAB read 12 MB
SAB wrote 2GB (probably the temp, and then the final)

I don't know if the unrar process was taken into these totals. I think not.
thestraycat
Newbie
Newbie
Posts: 10
Joined: May 18th, 2020, 4:39 pm

Re: Using RAM for temp files and RAR extraction

Post by thestraycat »

I suppose that's to be expected. But you dont know where each 1gb was written too right?
thestraycat
Newbie
Newbie
Posts: 10
Joined: May 18th, 2020, 4:39 pm

Re: Using RAM for temp files and RAR extraction

Post by thestraycat »

@sander - do you have an example post-processing script that could be used?
User avatar
sander
Release Testers
Release Testers
Posts: 8829
Joined: January 22nd, 2008, 2:22 pm

Re: Using RAM for temp files and RAR extraction

Post by sander »

thestraycat wrote: February 21st, 2022, 10:55 am @sander - do you have an example post-processing script that could be used?
a pp-script for what?
thestraycat
Newbie
Newbie
Posts: 10
Joined: May 18th, 2020, 4:39 pm

Re: Using RAM for temp files and RAR extraction

Post by thestraycat »

@sander
sander wrote: May 18th, 2020, 5:27 pm Yes you can. It's called a RAM Disk or RAM Drive. Set it up at OS level, and point Incomplete to it. EDIT: unrar directs to Complete, so (as your subject) also point Complete to the RAM Drive, and after that do a move with a post processing script

I was wonering if there were any known community scripts or similar circulating on the forum that you knew of that would be a good starting point to help post process the files after setting up the ramdisk.

I personally use all the 'arr container to deal with a lot of my the file moving and renaming so would it still be recommended to use a post processing script in this ocassion in your opinion?
User avatar
sander
Release Testers
Release Testers
Posts: 8829
Joined: January 22nd, 2008, 2:22 pm

Re: Using RAM for temp files and RAR extraction

Post by sander »

I don't understand what you want, and how it is related to RAM disk.
thestraycat
Newbie
Newbie
Posts: 10
Joined: May 18th, 2020, 4:39 pm

Re: Using RAM for temp files and RAR extraction

Post by thestraycat »

@sander - Haha, noticed this thread never got finished!

You mentioned in a previous post above in this thread to use a post-processing script as part of the testing of the ramdrive, i was simply asking if you had one that you could share..
Yes you can. It's called a RAM Disk or RAM Drive. Set it up at OS level, and point Incomplete to it. EDIT: unrar directs to Complete, so (as your subject) also point Complete to the RAM Drive, and after that do a move with a post processing script
User avatar
sander
Release Testers
Release Testers
Posts: 8829
Joined: January 22nd, 2008, 2:22 pm

Re: Using RAM for temp files and RAR extraction

Post by sander »

in 2020 I wrote: "unrar directs to Complete, so (as your subject) also point Complete to the RAM Drive, and after that do a move with a post processing script"

So: the PP script is only for moving the file(s) from the ramdisk-dir to another destination. I don't have suchs a script, but it will be a few lines, including shutil.move().

The main thing of this thread is the RAM-drive ... so, did you set that up?
Post Reply