折腾本腾
Plex: Guide to Moving Transcoding to RAM - Docker Containers - Unraid
00 分钟
2024-1-17
2024-3-2
type
status
date
slug
summary
tags
category
icon
password
URL
Hey everyone, just thought I'd put this up here after reading a syslog by another forum member and realizing a repeating pattern I've seen here where folks decide to let Plex create temporary files for transcoding on an array or cache device instead of in RAM.
Why should I move transcoding into RAM? What do I gain?
In short, transcoding is both CPU and IO intensive. Many write operations occur to the storage medium used for transcoding, and when using an SSD specifically, this can cause unnecessary wear and tear that would lead to SSD burnouts happening more quickly than is necessary. By moving transcoding to RAM, you alleviate the burden from your non-volatile storage devices. RAM isn't subject to "burn out" from usage like an SSD would be, and transcoding doesn't need nearly as much space in memory to perform as some would think.
How much RAM do I need for this?
A single stream of video content transcoded to 12mbps on my test system took up 430MB on the root ram filesystem. The quality of the source content shouldn't matter, only the bitrate to which you are transcoding. In addition, there are other settings you can tweak to transcoding that would impact this number including how many second of transcoding should occur in advance of being played. Bottom line: If you have 4GB or less of total RAM on your system, you may have to tweak settings based on how many different streams you intend on transcoding simultaneously. If you have 8GB or more, you are probably in the safe zone, but obviously the more RAM you use in general, the less space will be available for transcoding.
How do I do this
There are two tweaks to be made in order to move your transcoding into RAM. One is to the Docker Container you are running and the other is a setting from within the Plex web client itself.
Step 1: Changing your Plex Container Properties
From within the webGui, click on "Docker" and click on the name of the PlexMediaServer container. From here, add a new volume mapping:
/transcode to /tmp
Click "Apply" and the container will be started with the new mapping.
Step 2: Changing the Plex Media Server to use the new transcode directory
Connect to the Plex web interface from a browser (e.g. ). From there, click the wrench in the top right corner of the interface to get to settings. Now click the "Server" tab at the top of this page. On the left, you should see a setting called "Transcoder." Clicking on that and then clicking the "Show Advanced" button will reveal the magical setting that let's you redirect the transcoding directory. Type "/transcode" in there and click apply and you're all set. You can tweak some of the other settings if desired to see if that improves your media streaming experience.
Thanks for reading and enjoy!
A data point: Plex transcoding 3:10 Yuma full 1080 blu-ray to a single 3mb 720 stream and at 50% the transcode folder size is 1GB. I expect ~2GB final size for just this one stream at movie completion. Transcoder is set for speed over quality.
edit: movie is at 1:33 out of 2:02:
Plex 0.9.14.2 is broken. Roll back to an older version.
I'm not convinced that it makes a big difference, but if you are sure you want to try...
Quote
How can we install an old plex docker image that works with ram transcoding?
Note: you might want to backup your Plex config folder first, in case reverting to an older version causes problems. I offer no warranty on this
You'll need to be running the LinuxServer docker, because it allows you to specify the exact version of Plex you want to run.
Go here and decide which version you want to try:
Click the "Computer" button next to that version, then go to Linux -> Ubuntu and copy the entire "Version" string. For instance, for 0.9.12.19 the version string is "0.9.12.19.1537-f38ac80"
Then go to the Volume Mappings docker page and enable the Advanced View option. Add an Environment Variable named VERSION and paste in the value you got from the archive page.
Then start the Plex docker. It should download and install the requested version.
I have the same question, using Plex without Docker. Saw your answer here, and most of the movies I stream work great on normal (lower quality) movies with 150MB in transcode directory.
But when I try higher quality movies, like Blu-Ray for example it doesn't play the movie, just stuck on loading and giving me the error down below in the log. It did work good before when I had the transcode directory on the disk.
I have set the transcode temp directory to /tmp in the web client and /tmp in the plex settings via unraid web client. Any clue what's wrong?
Quote
You need to do the following in youyr plex VM:
sudo mkdir /mnt/RAM_disk...
...Now go into plex, and change the temporary transcode directory (settings, server, transcoder).
  • EDIT* Tried the above too, but that gave no sucess. Same error... Down below is the log. I just censored out the path to the hobbit movie. :'(
There has been a lot of changes made to the Plex transcoder since this thread was started.
I assume you a running Plex in a Docker container, then the easiest way to get it to work is to transcode to disk and then preferably an SSD. You need to setup the Plex container with a mapping to a folder and also specify the mount point to this folder in the Plex app.
Plex does a lot of logging so it might be worth to check the Plex Media Server log for errors (not the container log).
Suggest you also look at the Plex forum, there as a lot of questions about transcoding there.
notion image
I'm experiencing the same thing. I have 32GB of RAM total, using 16GB for my primary VM. It took me a while to figure out what was causing this because it had been working flawlessly for so long. Then I started realizing that it only happened when I was watching a channel on DVR for a long period of time. When it filled up the RAM it would lock the entire WebUI up (not that I would expect any less). I would then have to shut down the VM in order to have enough RAM to restart some of the services.
Thanks for confirming others are having the same issue. I've moved my transcode directory back to SSD for now.
notion image

评论
Loading...