Plex: Guide to Moving Transcoding to RAM


Recommended Posts

Has anyone seen issues with this with 4K HDR transcoding on the fly to 1080p? I am using /tmp as my transcode directory and verified it’s working but does Plex manage the transcode bits in a first in first out fashion so it won’t overrun my system RAM?

 

I have 32GB RAM with 16GB dedicated to a Windows VM so 16GB available to Unraid.

Edited by nickp85
Link to comment
34 minutes ago, nickp85 said:

but does Plex manage the transcode bits in a first in first out fashion so it won’t overrun my system RAM?

 

yes, Plex does it and also removes "old" transcodes when space getting low, still may consider adding a ram disk with like 4 GB for Plex only so in terms you have long runs your overall system wont be "always loaded" when you need to transcode (which only should be used for remote view's only)

  • Like 1
Link to comment
  • 1 month later...

I just want to mention that you cannot have the ram disk set as 8GB while Plex docker memory restrict to 4GB. It will likely to crash Plex itself because docker memory usage includes the usage of the ram disk too. I had Plex crashing (transcoder error) when it reaches the 4GB limit of docker memory restriction. Then I removed the Plex docker memory limit but keep the ram disk limit to 8GB and it worked fine.

Link to comment
19 minutes ago, bergi9 said:

Then I removed the Plex docker memory limit but keep the ram disk limit to 8GB and it worked fine.

Note: If you use the new Download feature, even those will be written to the RAM. Sadly the complete movie and deletion is done after successful download.

 

Because of that I'm using 34GB, now.

 --mount type=tmpfs,destination=/tmp,tmpfs-size=34000000000 --memory=34G

 

Link to comment

I'm having an odd issue with transcode to memory on 1 specific movie.

 

So just to establish I am successfully transcoding to memory with --mount type=tmpfs,destination=/transcode,tmpfs-size=4000000000

and /tmp directory in plex. I also confirmed this with df -h.

 

But for some reason when I play the movie "Cars" which is 4K HEVC and transcode to H264 I get the error "Not enough disk space to convert this item".

 

As a test, I edited to use up to 8 gigs of memory "--mount type=tmpfs,destination=/transcode,tmpfs-size=8000000000" and retested and no change.


What else could cause this? I tested 8 other 4K HEVC movies which do not have this issue at all. See screenshot of df -h below.

 

image.png.59472ec5566100bb7dc5517911a4c72c.png

Edited by TopherHax
Link to comment
1 hour ago, TopherHax said:

What else could cause this?

i guess (and its really a guess) its the audio line, as  sample, i also would need min 3 GB Ram Disk when i playback a DTS-HD movie as i use ARC and the TV cant playback DTS-HD Audio ... may take a look at the audio lines if there is a difference.

Link to comment

Hi,

 

I'm having some issues transcoding to RAM.

 

I'm running the following parameters in my Plex container:

image.png.0f9f9b50f78d829e9471c173a90fb6e5.png

--runtime=nvidia --device=/dev/dri --mount type=tmpfs,destination=/tmp,tmpfs-size=20000000000 --no-healthcheck

 

The GPU is responding just fine:

image.png.f9e1ad5606ecc4cd71d49517f335392b.png

 

I've configured /tmp as my transcode directory within Plex:

image.png.2d0f1747c9bdc94971f250c298a26e9c.png

 

But /tmp is not showing up when I run the "df -h" command.

image.png.4973b936a805f99226eb318585dd94fe.png

 

Did I overlook something?

 

 

Link to comment

You don’t need those parameters in the Docker container, just map the container /transcode to /tmp on host and point Plex to /transcode.

 

side note, I had issues with this because on a longer transcode Plex would exhaust system RAM so I scripted something to create a subfolder of /tmp with 8GB of my RAM as a ramdisk so Plex can’t use more than a certain about of RAM. I have 32GB with 16GB given to a VM. Giving 8GB to Plex keeps it from overrunning the available memory. So I use /tmp/PlexRamScratch on Unraid mapped to /transcode in container.

 

This is the script I put into User Scripts plugin to run at first start of the array only.

#!/bin/bash
mkdir /tmp/PlexRamScratch
mount -t tmpfs -o size=8g tmpfs /tmp/PlexRamScratch

 

Edited by nickp85
Link to comment

So even with my plex ram cache set to 32G using @mgutt advanced config, im still seeing plex crash when a user tries to download multiple movies. My friend tried to download multiple movies in anticipation for an overseas trip and it was causing the plex instance to crash and the downlaods to fail completly. Looks like im going back to my NVME drive for plex transcodes.

Link to comment
On 2/7/2022 at 9:26 PM, Bolagnaise said:

So even with my plex ram cache set to 32G using @mgutt advanced config, im still seeing plex crash when a user tries to download multiple movies. My friend tried to download multiple movies in anticipation for an overseas trip and it was causing the plex instance to crash and the downlaods to fail completly. Looks like im going back to my NVME drive for plex transcodes.

I think I saw something about Plex downloads going entirely into the transcode folder. If you’re doing like 4K HDR stuff bigger than 32GB you’ll blow out the RAM and it won’t work

Link to comment
12 hours ago, nickp85 said:

I think I saw something about Plex downloads going entirely into the transcode folder. If you’re doing like 4K HDR stuff bigger than 32GB you’ll blow out the RAM and it won’t work

Don't downloads go to the device you are downloading them on?  Like if I was traveling and wanted to download episodes/movies, they would go onto the tablet/phone I am taking with me, not the Plex server.

 

Am I wrong in my thinking here?

Link to comment

Yeah my friend tried to download around 5 movies all around 10GB each at 1080p 8mbps quality and it caused my plex instance to crash multiple times using the new downloads feature, as already mentioned it seems to store the entire transcoded file in the /transcode mapping folder in its entirety until it’s been downloaded by the client, if the ram becomes full the plex instance will lockup and crash. I’ve switched backed to NVME for my transcode and had him run the same test and the plex server has no issues. Hopefully plex allows us to map a separate downloads folder to store transcoded content that requires downloading in the future.  

Link to comment
6 hours ago, Bolagnaise said:

Yeah my friend tried to download around 5 movies

What about the "Maximum simultaneous video transcode" transcoder setting? Set it to 3 and let the friend select 5 Downloads. I think it will put the additional 2 in the queue until the others have finished.

Link to comment
  • 3 weeks later...
  • 3 weeks later...

Haven't figured out how to transcode on RAM when upgrading to 6.10 RC. Tried a few methods mentioned above, plex still transcoding using cache. Can't even see /dev/shm folder as i used to be able in 6.9 when used the container: /transcode method. 

Link to comment
On 3/20/2022 at 2:17 PM, Ronin said:

Haven't figured out how to transcode on RAM when upgrading to 6.10 RC. Tried a few methods mentioned above, plex still transcoding using cache. Can't even see /dev/shm folder as i used to be able in 6.9 when used the container: /transcode method. 

Same

 

Link to comment
  • 2 months later...

Hi!

Is there a way to test that the transcode is happening on the RAM please? It should be working but would like to know if there is a way I can check it is not transcoding on the nvme drive. 

 

Also, I am allocating 20GB with my parameter, does that "lock out" 20GB for plex (Will show as used in unraid) or just allow it to use 20GB of what is available?

 

Thank you

 

I am using a threadripper 2950X so no cpu capabilities

 

--mount type=tmpfs,destination=/tmp,tmpfs-size=20000000000 --no-healthcheck

 

image.png.e82e1a76f8bfe13550f3e1cbb5a4b834.png

 

 

Edited by mbc0
added extra question
Link to comment
  • 1 month later...
On 3/1/2022 at 4:02 AM, mgutt said:

Since a few days mine does not work anymore. My TV said "not enough storage". Had to give up RAM transcoding at all :(

 

I’ve even thinking about this for a while, their is a SWAP file plugin for Unraid 6.9 and above. This may be a workaround to getting transcoding back onto ram. I will test and report back.

Link to comment

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

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.