How to setup a "RAM Disk" (2024)

ballen
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!

toytown
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.

ballen
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 How to setup a "RAM Disk" (4)

...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 How to setup a "RAM Disk" (5))

Thanks for your reply, I appreciate it @toytown!

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.

TheDreadPirate
Offline


Community Moderator

Posts: 7,922
Threads: 9
Joined: 2023 Jun

Reputation: 237

Country:How to setup a "RAM Disk" (8)

#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

Anders
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?

Efficient_Good_5784
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.

5cdru1ls
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?

TheDreadPirate
Offline


Community Moderator

Posts: 7,922
Threads: 9
Joined: 2023 Jun

Reputation: 237

Country:How to setup a "RAM Disk" (13)

#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

pcm
Offline


Member

Posts: 62
Threads: 4
Joined: 2024 May

Reputation: 0

Country:How to setup a "RAM Disk" (15)

#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.

How to setup a "RAM Disk" (2024)

FAQs

How do I allocate disk RAM? ›

It's under the “Virtual memory” header. This opens the Virtual Memory dialog, which is where you can configure how much of your hard drive will be used as RAM. Un-check “Automatically manage paging file size for all drives.” Now you can edit the options on this screen. Click your SSD drive.

What is RAM disk configuration? ›

RAM Disk Configuration Option. Description. Disk Memory Type. Specifies the type of memory to use from the available memory pool in system to create a disk.

How to create RAM from hard disk? ›

How to Use a Hard Drive as RAM on Windows
  1. Access the Start menu and right-click on Computer. ...
  2. Under System Properties, select the Advanced tab. ...
  3. Select the Advanced tab and choose the Change button located near the bottom of the window. ...
  4. Find and choose the external hard drive from the list.
Jun 16, 2022

How should I set up my RAM? ›

How to Install RAM in PC
  1. Locate the RAM slot on your motherboard.
  2. Push down the locking tab(s) at the end of each slot.
  3. Line up the RAM stick with the slot, ensuring that the notch of the RAM stick matches that of the slots. ...
  4. Push down the RAM stick straight down until it makes a clicking sound.
Aug 11, 2023

How does a RAM disk work? ›

RAM disks are created by partitioning capacity from system memory (aka RAM) using software, and they provide incredibly fast I/O (read and write) performance, many times faster than today's fastest SSDs, with wider bandwidth and extremely low latencies. Using system memory as storage has its pros and cons.

How do I arrange my RAM? ›

To take full advantage of multi-channel memory, a pair of RAM modules should be inserted into different memory channels. However, this is where the modules are often inserted incorrectly. They must be inserted in the first and third slots, or the second and fourth slots, and not next to each other.

How do I install RAM drives? ›

To install the new RAM, align the notch on the RAM stick with the ridge in the slot, and firmly press the RAM into the slot until the side clips snap into place, securing the RAM. It's important to apply even pressure across the top of the module to avoid damaging the sticks or the motherboard.

How to install RAM by yourself? ›

The tabs are located at both ends of the memory socket. Align the memory module key(s) along with the memory socket keys(s) for proper installation. Press the memory into the socket until the tabs snap into place and secure the memory module. Replace the computer cover and plug in the AC power cord.

How do I check my RAM configuration? ›

How to check how much RAM you have on Windows 10
  1. Step 1: Click “Start” ...
  2. Step 2: Find “About Your PC” ...
  3. Step 3: Navigate to “Device Specifications” ...
  4. Step 4: Find out how much RAM you have. ...
  5. Method 1– ctrl, shift, esc. ...
  6. Method 2 – ctrl, alt, del. ...
  7. Method 3 – start, task manager, performance.

What should RAM be set to? ›

1. Set your RAM speed in BIOS to something a little less than 3600 (less than 1800 in CPU-Z or in BIOS if your BIOS doesn't show the doubled rate). Depending on your CPU's multiplier, it could be 35XX or 34XX, where the "X" is a number.

What do you use RAM disk for? ›

Using a RAM disk for virtual machines can improve their performance. Since a RAM disk is faster than a typical physical disk, a virtual machine can run and access data faster. Compiler output. For a software developer, it makes sense to redirect intermediate compiler output to a temporary folder located on a RAM disk.

How to create a RAM disk on Windows? ›

Run ImDisk. On the Basic tab [1], select the size of RAM [2] you want to allocate to the RAM Disk. You can also opt for Dynamic Memory feature by checking 'Allocate Memory Dynamically' [3]. Leave the rest of the settings on default and click on OK [4] to create the RAM Disk.

How to allocate disk space to RAM? ›

Open Task Manager by pressing Ctrl + Alt + Del or typing Task Manager into Windows search and click on this desktop app from search result. Shift to the Performance tab and then select Memory from the left pane. Take a look at the value under Committed (which is the total of your RAM and virtual memory).

Why can't hard disk be used as RAM? ›

All major operating systems (macOS, Linux, and Windows) already do that. It's called virtual memory. Keep in mind that real RAM is many times faster than a hard disk, so if you have a RAM-hungry app, this will work but make it very slowly.

How do I configure RAM slots? ›

If you have two memory bars in four slots, you should use the second and fourth slots. If you have four slots and four memory, you should insert a matching pair in the first and third slots and another matching pair in the second and fourth slots.

How to activate RAM slots in BIOS? ›

Boot the machine and press F1 to get into BIOS, then select Advanced Settings, then Memory Settings, and change the corresponding DIMM slots option to "Row is enabled". Save the BIOS settings and reboot.

References

Top Articles
Latest Posts
Recommended Articles
Article information

Author: Edmund Hettinger DC

Last Updated:

Views: 6370

Rating: 4.8 / 5 (58 voted)

Reviews: 81% of readers found this page helpful

Author information

Name: Edmund Hettinger DC

Birthday: 1994-08-17

Address: 2033 Gerhold Pine, Port Jocelyn, VA 12101-5654

Phone: +8524399971620

Job: Central Manufacturing Supervisor

Hobby: Jogging, Metalworking, Tai chi, Shopping, Puzzles, Rock climbing, Crocheting

Introduction: My name is Edmund Hettinger DC, I am a adventurous, colorful, gifted, determined, precious, open, colorful person who loves writing and wants to share my knowledge and understanding with you.