Jellyfin Forum
Best practices for ram disks - Printable Version

+- Jellyfin Forum (https://forum.jellyfin.org)
+-- Forum: Off Topic (https://forum.jellyfin.org/f-off-topic)
+--- Forum: General Discussion (https://forum.jellyfin.org/f-general-discussion)
+--- Thread: Best practices for ram disks (/t-best-practices-for-ram-disks)



Best practices for ram disks - TheDreadPirate - 2023-06-26

What is everyone's opinion for ram disk best practices?  This can be specific to Jellyfin or in general.

I saw in gaming09's signature that he used a ram disk for transcoding files.  I decided to do that as well for performance reasons and to reduce the amount of writes to my SSD.  Even though my aging Intel x25-M G2 still has 97% of its write endurance left.

Is there any reason to use /dev/shm over setting up a tmpfs in an arbitrary directory?  I opted for the latter.


RE: Best practices for ram disks - TheTrueLinuxDev - 2023-06-27

Well if you run the following command: df /dev/shm
you may receive an output as thus:


Filesystem    1K-blocks  Used Available Use% Mounted on
tmpfs          65882212 78864  65803348  1% /dev/shm


/dev/shm is always configured to be tmpfs whereas /tmp varies on different linux distro and /var/tmp should not be tmpfs since the temporary files in /var/tmp should persist between reboots.


RE: Best practices for ram disks - iconoclasthero - 2023-12-03

So I just started using Jellyfin (and I haven't gotten transcoding to work yet), but I was looking back into the OP's question and found it via a google search for ca. "best practices for ramdisk ubuntu."  I've been using /dev/shm/cache for quite a number of years now with no problem.  What I don't know is if there are any drawbacks to using that and if it is really using ram or if tmpfs is also putting stuff on disk.  I have ca. 24 GB ram and am always using /dev/shm/cache for all kinds of file manipulation/work so that I don't write stuff to media until I'm done...or if I just want to put stuff in a volitile space that won't be there when I reboot.

Are there any known disadvantages to using /dev/shm/ for ram drive I should know about?


Code:
$ pwd; df .
/dev/shm/cache
Filesystem      Size  Used Avail Use% Mounted on
tmpfs            12G  3.6G  8.3G  30% /dev/shm



RE: Best practices for ram disks - iconoclasthero - 2023-12-03

ramfs vs. tmpfs: https://unix.stackexchange.com/questions/66329/creating-a-ram-disk-on-linux