How to Configure Plex on unRAID to Transcode to RAM

How to Configure Plex on unRAID to Transcode to RAM
Photo by Tyler Daviaux / Unsplash

When I started my journey with unRAID in early August 2024, I had 32GB of RAM, which seemed plenty for my setup. I was running Plex along with a collection of *arr apps and several other containers, and things were running smoothly. However, after diving deeper into managing resources efficiently, I realized that, in theory, I had overprovisioned my system’s resources by a lot.

At the time, I had around 50 Docker containers running. If every container tried to use the maximum amount of RAM I assigned, my system would need over 100GB of RAM. Recognizing this, I upgraded to 96GB of RAM, the maximum supported by my ROG STRIX B760-I GAMING WIFI mainboard and Intel® Core™ i5-13600T processor.

After the upgrade, I noticed I had an average of 70GB of unused RAM, except during periods of high activity across multiple containers. This led me to explore more efficient ways of utilizing my available memory. When I stumbled across the idea of transcoding Plex media directly to RAM in a Reddit comment within the official Plex subreddit, it immediately made sense as a way to leverage the extra memory I had sitting idle. I started looking into how I could accomplish this on unRAID.
Eventually, I found the answer in another Reddit post within the official unRAID subreddit, that provided instructions on configuring Plex to transcode to RAM.

Don’t want to handle this on your own? If you need help or prefer assistance, you can schedule a remote call/meeting for personalized support.

Why Transcoding to RAM Is Beneficial

Transcoding media files to RAM offers several key benefits:

  1. Speed: RAM is far faster than SSDs or hard drives. Transcoding temporary files directly to RAM leads to quicker read/write operations, reducing buffering and improving overall performance.
  2. Reduced Wear on SSDs and Hard Drives: Writing temporary transcoding files to a hard drive can generate thousands of small files, wearing down SSDs and potentially decreasing their lifespan. RAM, on the other hand, doesn't suffer from this issue.
  3. Lower Power Consumption: Using your SSD or hard drive for constant read/write operations can increase power consumption. RAM uses less power, contributing to a more efficient setup.

Minimum RAM Requirements for Transcoding to RAM

While transcoding to RAM can improve performance, it requires enough memory to avoid overloading your system. Here's a general breakdown of how much RAM is needed per user stream:

  • 720p stream: ~1 GB of RAM per stream
  • 1080p stream: ~2-3 GB of RAM per stream
  • 4K stream: ~4-8 GB of RAM per stream

Given this, if you expect multiple users streaming simultaneously, you’ll need to ensure your system has enough RAM. For instance, if two users are streaming 1080p content at the same time, you should allocate around 6 GB of RAM just for transcoding, in addition to what your other containers need. Having 16 GB of total RAM is a safe minimum, though larger setups may benefit from 32 GB or more.

How to Set Up Plex to Transcode to RAM

Here’s a step-by-step guide to configure Plex to transcode to RAM on unRAID:

  1. Configure the Transcoding Path in DockerThis will map Plex’s transcoding path to your system’s RAM, where /dev/shm/ represents shared memory.
    • Open your unRAID Docker tab and locate your Plex container.
    • Click Edit to modify the container’s settings.
    • Scroll down to the Path, Port, Variable, Label section, and click Add another Path, Port, Variable.Configure the path as follows:
      • Name: Transcode
      • Container Path: /transcode
      • Host Path: /dev/shm/
  2. Adjust Plex SettingsPlex will now use the RAM disk for transcoding, significantly speeding up the process.
    • Open Plex via the Plex Web UI.
    • Navigate to Settings > Transcoder.
    • In the Transcoder temporary directory field, set the value to /transcode.

Conclusion

Transcoding to RAM is a powerful performance boost for your Plex setup, especially when you're running a multi-container environment like I am. With proper resource allocation—described in my guide on "Optimizing Resource Allocation for Docker Containers on unRAID"—you can make full use of your system’s available memory and CPU cores without overloading your server. Whether you're streaming 720p, 1080p, or even 4K content, transcoding to RAM can improve playback quality and reduce wear on your drives.

With my upgraded 96GB of RAM, Plex now operates more smoothly than ever, and transcoding no longer taxes my system’s storage. If you have extra RAM available, this no-brainer optimization can elevate your media streaming experience.

If you’ve found this content helpful and would like to support the blog, consider donating by clicking here. Your support is greatly appreciated!

Read more