Offline
Junior Member
Posts: 9
Threads: 3
Joined: 2023 Oct
Reputation: 0
#1
2023-10-17, 10:59 AM
Good morning guys,
I've seen mention (in various forum posts) of adding a RAM disk for transcoding to RAM but haven't been able to find a way to set this up?
I'm currently running Jellyfin in a Debian 12 virtual machine (on TrueNAS Scale) - Just my preferred way to run it on TrueNAS to avoid any potential upgrade issues with the TrueNAS Scale Apps in future (I experienced this in the past). I am using an NVidia Quadro P1000 (as I use an AMD CPU) which is passed through into the VM and working as expected.
So my question is: Does anyone know how I can setup a "RAM disk"(maybe link to a document explaining it?) or is it simply changing the Transcode path to /tmp or /dev/shm?
My server has a ton of RAM and so that shouldn't be an issue!
Thanks in advance!
Offline
Member
Posts: 54
Threads: 2
Joined: 2023 Jun
Reputation: 3
#2
2023-10-17, 11:52 AM
Depending on the quality of your collection you may find that you actually don't have enough RAM. I just opened up 1 of my 4K movies and transcoding it set to "auto" took up 81GB in the transcode folder, or in your case this would have been 81GB of ram needed and that's just for a single transcode. If you run out of RAM then the transcode will fail and the movie will stop at the position it ran out of space at.
Even one of the cheap (45$ 1TB SSD) is going to give you around 50,000 transcodes before you hit the warranty endurance level and most SSDs ive seen will hit 2x-3x that easily.
Offline
Junior Member
Posts: 9
Threads: 3
Joined: 2023 Oct
Reputation: 0
(2023-10-17, 11:52 AM)toytown Wrote: Depending on the quality of your collection you may find that you actually don't have enough RAM. I just opened up 1 of my 4K movies and transcoding it set to "auto" took up 81GB in the transcode folder, or in your case this would have been 81GB of ram needed and that's just for a single transcode. If you run out of RAM then the transcode will fail and the movie will stop at the position it ran out of space at.Even one of the cheap (45$ 1TB SSD) is going to give you around 50,000 transcodes before you hit the warranty endurance level and most SSDs ive seen will hit 2x-3x that easily.
Ah ok, so maybe best I just mount a new SSD share into the VM and use that for transcoding - RAM wise I have 128GiB of RAM on the host machine but I can see that 1x 4K transcode is already near to depleteing that
...I'll wait for other suggestions from the community but will otherwise look to mount an SSD (mainly just so I don't kill my expensive VM SSD during transcode - now I know )
Thanks for your reply, I appreciate it @toytown!
Offline
Member
Posts: 54
Threads: 2
Joined: 2023 Jun
Reputation: 3
#4
2023-10-17, 12:10 PM
Also sorry i missed your initial question, but yes using /dev/shm works as a ramdisk. I think i initially used a tmpfs as well but that comes with a fixed size. Definitely give it a try, if your movies can generally fit in your ram then you're going to be good to go.
Offline
Community Moderator
Posts: 7,922
Threads: 9
Joined: 2023 Jun
Reputation: 237
Country:
#5
2023-10-17, 01:11 PM
A RAM disk is only suggested if you don't have an SSD in your system. Or, if you're like me, have an ooooold SATA2 SSD with pretty slow write speeds.
If you have straight off the disc 4K HDR, 50-70Mbps, 50-75GB in size, your transcodes are going to be about that big or larger. You have to do a lot of testing to see how your system handles those transcodes. Monitor how big the transcode directory becomes.
The general wisdom with 4K HDR media is to keep it in a separate library. Pre-transcode your 4K HDR to 1080P SDR and put that 1080P copy in your main library. And for your clients/users with 4K HDR capable setups they can go to the 4K library and not have to transcode.
Jellyfin 10.9.9
Ubuntu 24.04 LTS (bare metal)
Intel i3 12100 on Asus Prime H610M-E D4 mATX
32GB DDR4-3600
Intel Arc A380
OS drive - SK Hynix P41 1TB
Storage
WD Green 3TB (Samba shares)
WD Red 3TB CMR (WIP Media, Test libraries)
3x WD Red Pro 6TB CMR in RAIDZ1 (JF Library)
Fractal Meshify 2
Corsair CX430
Offline
Junior Member
Posts: 3
Threads: 1
Joined: 2024 May
Reputation: 0
#6
2024-06-06, 11:05 AM
How much will a 1080p x265 take in space (ram/hdd wise) in transcode?
Offline
Community Moderator
Posts: 735
Threads: 2
Joined: 2023 Jun
Reputation: 28
#7
2024-06-06, 11:22 AM (This post was last modified: 2024-06-06, 11:27 AM by Efficient_Good_5784. Edited 1 time in total.)
(2024-06-06, 11:05 AM)Anders Wrote: How much will a 1080p x265 take in space (ram/hdd wise) in transcode?
It entirely depends on the transcode's overall bitrate and duration.
If you want a quick estimate, the transcode will be about the same size as the original file as long as your transcoding from and to the same codec.
Now, if you're asking what the filesize will be from H264 to H265, that will be harder to guess, but easy to figure out if you provide the bitrate and video duration.
As an example, lets say a transcode comes out to 5Mbps and the video's duration is 20 minutes. The math is as follows:
5Mbps * 60sec = 300Mb
300Mb * 20min = 6000Mb
6000Mb / 8 = 750MB
So the transcode would come out to roughly 750MB in size.
Offline
Junior Member
Posts: 3
Threads: 0
Joined: 2024 Jun
Reputation: 0
#8
2024-06-10, 10:01 PM
(2023-10-17, 10:59 AM)ballen Wrote: Good morning guys,I've seen mention (in various forum posts) of adding a RAM disk for transcoding to RAM but haven't been able to find a way to set this up?
I'm currently running Jellyfin in a Debian 12 virtual machine (on TrueNAS Scale) - Just my preferred way to run it on TrueNAS to avoid any potential upgrade issues with the TrueNAS Scale Apps in future (I experienced this in the past). I am using an NVidia Quadro P1000 (as I use an AMD CPU) which is passed through into the VM and working as expected.
So my question is: Does anyone know how I can setup a "RAM disk"(maybe link to a document explaining it?) or is it simply changing the Transcode path to /tmp or /dev/shm?
My server has a ton of RAM and so that shouldn't be an issue!
Thanks in advance!
Not sure what your trying to accomplish / what would your setup benefit from transcoding to ramdisk you mean?
Offline
Community Moderator
Posts: 7,922
Threads: 9
Joined: 2023 Jun
Reputation: 237
Country:
#9
2024-06-11, 04:05 PM
Using a RAM disk reduces wear on a SSD when transcoding (which are written to disk). But modern SSDs have quite a lot of write endurance, especially larger drives.
Jellyfin 10.9.9
Ubuntu 24.04 LTS (bare metal)
Intel i3 12100 on Asus Prime H610M-E D4 mATX
32GB DDR4-3600
Intel Arc A380
OS drive - SK Hynix P41 1TB
Storage
WD Green 3TB (Samba shares)
WD Red 3TB CMR (WIP Media, Test libraries)
3x WD Red Pro 6TB CMR in RAIDZ1 (JF Library)
Fractal Meshify 2
Corsair CX430
Offline
Member
Posts: 62
Threads: 4
Joined: 2024 May
Reputation: 0
Country:
#10
2024-06-11, 07:04 PM (This post was last modified: 2024-06-11, 07:23 PM by pcm. Edited 6 times in total.)
(2023-10-17, 10:59 AM)ballen Wrote: Good morning guys,I've seen mention (in various forum posts) of adding a RAM disk for transcoding to RAM but haven't been able to find a way to set this up?
I'm currently running Jellyfin in a Debian 12 virtual machine (on TrueNAS Scale) - Just my preferred way to run it on TrueNAS to avoid any potential upgrade issues with the TrueNAS Scale Apps in future (I experienced this in the past). I am using an NVidia Quadro P1000 (as I use an AMD CPU) which is passed through into the VM and working as expected.
So my question is: Does anyone know how I can setup a "RAM disk"(maybe link to a document explaining it?) or is it simply changing the Transcode path to /tmp or /dev/shm?
My server has a ton of RAM and so that shouldn't be an issue!
Thanks in advance!
I have 128 GB RAM on my ubuntu workstation so I set this up as it was a no brainer thing to do... (Not just for jellyfin but for other stuff)..
On ubuntu it's pre-baked and it enabling tmp.mount
service turns mounts /tmp
as tmpfs
. I also updated my tmp.mount
script to create the necessary subdirectories when the service starts on boot.
I am not entirely sure about debian. I don't think they have tmp.mount service. But, setting up RAMdisk and enabling itto auto-mount on boot is very straightforward. Just follow the steps here-
https://www.linuxbabe.com/command-line/c...disk-linux
Once you create your ramdisk, you just need to update your jellyfin config in your dashboard to point to the RAMdisk mount point.
In my case, I have my cache and transcode paths on my RAMdisk as separate directories.
/tmp/jellycode - for my transcodes
/tmp/jellycache - for my cache
You set your transcode path in "dashboard"->"playback"->"transcode path"
You set your cache path in "dashboard" -> "general" -> "cache path"
I guess one caveat worth mentioning is that tmpfs
is not technically a pure ramdisk
or ramfs
... If the linux kernel senses too much memory pressure, then it will swap-out the contents inside tmpfs
onto disk. So, you gotta ensure you're not running any other memory-hog applications on the same machine hosting jellyfin.