Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Plex: Guide to Moving Transcoding to RAM

Featured Replies

On 12/15/2023 at 10:17 PM, craigr said:

 

My go file PLEX lines:

 

#Limit PLEX Transcode RAM Drive Size
mkdir /tmp/PlexRamScratch
chmod -R 777 /tmp/PlexRamScratch
mount -t tmpfs -o size=32g tmpfs /tmp/PlexRamScratch

 

image.thumb.png.022f2d3f5777ea953665c964f5995fbf.png

 

image.thumb.png.743c30210d79b596401e05bafba12161.png

 

image.thumb.png.ffc33220609d5a7ad3256716be31db34.png

 

I do not have any extra parameters.  I am however using the Intel IGPU not Nvidia.

 

Good luck!

Thanks for the writeup, what about adding in a script to check every 24h for files older than 24h and delete them? I just checked my ram transcoding folder and indeed didn't clean up properly after the last transcode. 

  • Replies 472
  • Views 380.5k
  • Created
  • Last Reply

Top Posters In This Topic

Most Popular Posts

  • By this guide Plex uses your RAM while transcoding which prevents wearing out your SSD.   Edit the Plex Container and enable the "Advanced View":   Add this to "Extra Paramet

  • Yesterday, I was lazy and set only "/dev/shm/plextranscode" as my transcoding path. I checked the path and it was created: ls /dev/shm plextranscode/   But it stays empty while transcoding

  • Yes it is needed as /transcode will be created, even it is not mapped through the containers settings.   So I will hopefully update my guide for the last time ^^ EDIT: Done.

Posted Images

so i'm trying to move transcode to RAM to see if it works better like everyone says.  im using the below documentation to do the settings.

 

https://github.com/binhex/documentation/blob/master/docker/faq/plex.md

 

however, everytime i change and apply the settings the entire plex container disappears from the docker.  i have to change the settings back to my ssd for transcode for it to reappear and work again.  is there something i'm doing wrong or missing?  i have transcode settings in plex set to /transcode even after i change the container settings.

 

any advice is appreciated.

29 minutes ago, trurl said:

post

thank you for this.  i will try again after i do a full backup of the appdata section.  i want to make sure i have the pms db backed up before trying to change the paths again, then i will run all logs to post.

 

appreciate you.

  • 4 weeks later...

Forgive me if this has already been asked, but when transcoding in the RAM, should you see (hw) for transcodes? I have everything configured as the guide suggests but no extra parameters, and no GPU. My CPU is 2x E5-2697v2's (no iGPU). When I do a test transcode it just says transcoding, without the (hw). I am a PlexPass subscriber, on the latest PMS, and my transcode directory is set to /transcode which maps to /tmp/PlexRamScratch (using the go file posted).

14 hours ago, thisguyneedsabeer said:

but when transcoding in the RAM, should you see (hw) for transcodes?

doesnt matter if RAM or disk, hw transcode means GPU usage ,,,

 

14 hours ago, thisguyneedsabeer said:

and no GPU. My CPU is 2x E5-2697v2's (no iGPU).

so, if you dont have any GPU (like a NV, AMD, ...) used for transcoding, and no iGPU ... hw do you expect to use hardware transcoding ? ;) when there is no hardware to transcode ... ;)

On 4/18/2024 at 3:45 AM, alturismo said:

doesnt matter if RAM or disk, hw transcode means GPU usage ,,,

 

so, if you dont have any GPU (like a NV, AMD, ...) used for transcoding, and no iGPU ... hw do you expect to use hardware transcoding ? ;) when there is no hardware to transcode ... ;)

That's what I was asking; does RAM count as hardware transcoding or is hardware transcoding strictly locked to iGPU/GPU?

6 minutes ago, thisguyneedsabeer said:

That's what I was asking; does RAM count as hardware transcoding or is hardware transcoding strictly locked to iGPU/GPU?

hardware transcoding means you transcode via gpu accel ... has nothing todo with RAM ...

 

moving transcoding to RAM is meant to prevent teardown from a disk ...

On 4/19/2024 at 3:11 PM, alturismo said:

hardware transcoding means you transcode via gpu accel ... has nothing todo with RAM ...

 

moving transcoding to RAM is meant to prevent teardown from a disk ...

That is the answer I was looking for, thank you.

  • 4 weeks later...
On 3/20/2024 at 3:39 AM, 10bn said:

Thanks for the writeup, what about adding in a script to check every 24h for files older than 24h and delete them? I just checked my ram transcoding folder and indeed didn't clean up properly after the last transcode. 

You know I've had this setup for a while and only recently users started reporting the "disk space" error. Every time I go in, the RAM transcode is full and not auto-clearing. Still haven't found a good fix or root cause (unless it's a bug that plex introduced sometime in 2024). 

  • 3 months later...

I've noticed Plex is using 14.79GiB / 31.19GiB this morning when the last play was a few hours ago. This is the highest usage I've seen.

 

/data/mnt/user/Media Library/
/config/mnt/user/Docker/Plex-Media-Server
/transcode/tmp

 

--mount type=tmpfs,destination=/tmp,tmpfs-size=4000000000

 

I thought the above would limit RAM usage for transcoding to 4gb. I'm just confused as to what's happening to cause almost 15gb usage in Plex from what should have been direct play over three hours ago.

1 hour ago, Pandemic said:

--mount type=tmpfs,destination=/tmp,tmpfs-size=4000000000

 

you shouldnt use /tmp as its a default tmpfs ... so prolly already existent when you trigger it ;)

 

rather name it like /plex_temp and set your mount to there ...

Good call. I think I had been using it like that for a number of years but I changed it to /plex_tmp and used:

--mount type=tmpfs,destination=/plex_tmp,tmpfs-size=4000000000

 

I'll report back with results. thanks!

2 hours ago, Pandemic said:

I'll report back with results. thanks!

you can always check in the terminal ... sample for /tmp

 

root@AlsServerII:~# df -h /tmp/
Filesystem      Size  Used Avail Use% Mounted on
rootfs           16G  1.5G   15G  10% /
root@AlsServerII:~#

 

which is already mounted per default with 1/2 RAM usually

8 hours ago, alturismo said:

you can always check in the terminal ... sample for /tmp

 

root@AlsServerII:~# df -h /tmp/
Filesystem      Size  Used Avail Use% Mounted on
rootfs           16G  1.5G   15G  10% /
root@AlsServerII:~#

 

which is already mounted per default with 1/2 RAM usually

I was just coming in to mention the Plex container is currently using: 12.79GiB / 31.19GiB while there has been no transcoding activity for at least 8 hours.

 

df -h /tmp/ shows:

root@name:~# df -h /tmp/
Filesystem      Size  Used Avail Use% Mounted on
rootfs           16G  1.1G   15G   7% /

 

df -h /plex_tmp/ shows:

root@Arc:~# df -h /plex_tmp/
Filesystem      Size  Used Avail Use% Mounted on
rootfs           16G  1.1G   15G   7% /

 

Both look fine but the docker tab in unraid is showing more consumption and over the 4gb I thought had been set.

 

 

1 hour ago, Pandemic said:

Both look fine but the docker tab in unraid is showing more consumption and over the 4gb I thought had been set.

 

thats 2 different things

 

1/ plex consumption itself (can be up and down, while 12 gigs are pretty high ;))

2/ some tempfs for transcoding ... different value ...

10 hours ago, alturismo said:

thats 2 different things

 

1/ plex consumption itself (can be up and down, while 12 gigs are pretty high ;))

2/ some tempfs for transcoding ... different value ...

For sure but the docker tab showing 12gb was different than both /tmp and /plex_tmp was showing. Is it possible the container was using extra memory not allocated to transcoding?

2 hours ago, Pandemic said:

Is it possible the container was using extra memory not allocated to transcoding?

thats what i try to say, plex docker consumes RAM, more or less ... has nothing todo with your tempfs mount for transcoding or other existing /tmp dirs etc ... different story.

 

if you want to limit Plex RAM consumption (or any other docker) you can add a different extra parameter

 

documented here as sample https://docs.docker.com/engine/containers/resource_constraints/

 

as sample in extra parameter --memory=4000m will limit the docker usage to 4 GB RAM

 

but be aware that issues can happen ;)

  • 1 month later...

I've been using the @mgutt recommended settings for years now. Until recently, it has always worked flawlessly.

 

For a few weeks now (that I have noticed), RAM usage doesn't seem to purge itself, even after transcoding has ended for many hours/days. The only way I have found to clear the RAM is to restart the Plex container.

My tmpfs-size is set to 16000000000. Oddly enough, RAM usage will always creep up to roughly 50% of that amount.

Right now, after inserting the command "df -h" into the Plex console, here is the return :

tmpfs            15G  7.4G  7.6G  50% /tmp

 

And if I restart my Plex container, it goes right back down to :

tmpfs            15G   12K   15G   1% /tmp

 

I don't know if this is the same problem as @Pandemic reported a few weeks ago, but this is definitely a new behaviour in my case.

Could this be linked to a new Plex Server update (I'm always using the latest stable release)? I have not yet tried reverting to an earlier Plex Server version, but I might eventually just to test it out.

 

Any ideas?

  • 3 months later...

I am noticing an issue with this and audio transcoding. I am playing an Atmos stream on Apple TV so it transcodes audio to FLAC. Video was direct play so nothing to really convert. I have 16GB tmpfs setup for Plex to transcode in RAM. When I start playing the media the usage goes up very fast until it hits 16GB and then stops playing with a transcoder error on the client. Once it crashes the transcode folder drops to 0 used.

 

I tried to throttle the transcoding to 30 seconds ahead but that didn't even help. I have no idea what is using up all the storage in the transcode directly from simply transcoding audio.

 

Any ideas?

Edited by nickp85

  • 6 months later...

I am struggling to set this up. For years I always used plex (linux server) with nvidia transcoding. Template has Transcode mapped as host:/dev/shm > container:transcode. This has worked well until recently when I set up a windows vm for blue iris cctv. Now I'm running into ram issues. So by adding this to Extra Parameters ** --mount type=tmpfs,destination=/tmp,tmpfs-size=4000000000 **. Do I need to change the container mapping to host:/tmp, something else or delete this mapping altogether? And inside the plex app settings, the Transcoder temp directory is /transcode. Does this need to be changed to something else as well?

  • 2 months later...
  • 4 months later...

@Bolagnaise where is that setting at? Would love to change the downloads location to a scratch SSD and remove that from Ram Transcode directory.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.