Page 1 of 1

Using RAM for temp files and RAR extraction

Posted: May 18th, 2020, 4:46 pm
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?

Re: Using RAM for temp files and RAR extraction

Posted: May 18th, 2020, 5:27 pm
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 ................

Re: Using RAM for temp files and RAR extraction

Posted: May 18th, 2020, 5:30 pm
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.

Re: Using RAM for temp files and RAR extraction

Posted: May 18th, 2020, 5:33 pm
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.

Re: Using RAM for temp files and RAR extraction

Posted: May 18th, 2020, 5:38 pm
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.

Re: Using RAM for temp files and RAR extraction

Posted: May 18th, 2020, 6:11 pm
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! ;-)

Re: Using RAM for temp files and RAR extraction

Posted: May 18th, 2020, 6:18 pm
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.

Re: Using RAM for temp files and RAR extraction

Posted: May 18th, 2020, 6:47 pm
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.

Re: Using RAM for temp files and RAR extraction

Posted: May 18th, 2020, 7:56 pm
by thestraycat
I suppose that's to be expected. But you dont know where each 1gb was written too right?

Re: Using RAM for temp files and RAR extraction

Posted: February 21st, 2022, 10:55 am
by thestraycat
@sander - do you have an example post-processing script that could be used?

Re: Using RAM for temp files and RAR extraction

Posted: February 21st, 2022, 11:20 am
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?

Re: Using RAM for temp files and RAR extraction

Posted: February 21st, 2022, 9:14 pm
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?

Re: Using RAM for temp files and RAR extraction

Posted: February 21st, 2022, 11:32 pm
by sander
I don't understand what you want, and how it is related to RAM disk.

Re: Using RAM for temp files and RAR extraction

Posted: October 22nd, 2022, 7:53 am
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

Re: Using RAM for temp files and RAR extraction

Posted: October 22nd, 2022, 8:30 am
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?