Plex Media Server transcoder using up all assigned RAM space

Server Version#: 1.29.0.6244
Player Version#: Chromecast? Not sure version as it is happening for a remote user

I have Plex set to use a tempfs (/tmp) directory I setup to store transcodes which has a size of 6GB. When the user is streaming the movie it seems to quickly use up all the space of the /tmp directory, within the first minute of the movie, which causes the transcoder to run out of space and close the session. Transcoder throttle buffer is set to 60 secs.

It appears that it’s only transcoding the audio portion of the media, as seen in the pic below, so I’m not sure why its using up 6GB?
image

Any idea on what is going on here?

XML info of media:

<MediaContainer size="1" allowSync="1" identifier="com.plexapp.plugins.library" librarySectionID="1" librarySectionTitle="Movies" librarySectionUUID="5c6d2dd3-8da1-444a-9988-01ad6977d35a" mediaTagPrefix="/system/bundle/media/flags/" mediaTagVersion="1663895717">
<Video ratingKey="8179" key="/library/metadata/8179" guid="plex://movie/5d776835151a60001f24dc1c" studio="Walt Disney Pictures" type="movie" title="Hocus Pocus" librarySectionTitle="Movies" librarySectionID="1" librarySectionKey="/library/sections/1" contentRating="PG" summary="After 300 years of slumber, three sister witches are accidentally resurrected in Salem on Halloween night, and it is up to three kids and their newfound feline friend to put an end to the witches' reign of terror once and for all." rating="3.9" audienceRating="7.1" viewOffset="1294350" lastViewedAt="1666007917" year="1993" tagline="It's just a bunch of Hocus Pocus." thumb="/library/metadata/8179/thumb/1664543036" art="/library/metadata/8179/art/1664543036" duration="5768054" originallyAvailableAt="1993-07-16" addedAt="1664543035" updatedAt="1664543036" audienceRatingImage="rottentomatoes://image.rating.upright" chapterSource="media" primaryExtraKey="/library/metadata/8180" ratingImage="rottentomatoes://image.rating.rotten">
<Media id="9300" duration="5768054" bitrate="11397" width="1920" height="1040" aspectRatio="1.85" audioChannels="6" audioCodec="dca" videoCodec="h264" videoResolution="1080" container="mkv" videoFrameRate="24p" audioProfile="dts" videoProfile="high">
<Part accessible="1" exists="1" id="9413" key="/library/parts/9413/1617441141/file.mkv" duration="5768054" file="/mnt/media/movies/Hocus Pocus (1993)/Hocus Pocus (1993) [imdb-tt0107120][Bluray-1080p][DTS 5.1][x264]-hd4u.mkv" size="8219110455" audioProfile="dts" container="mkv" deepAnalysisVersion="6" requiredBandwidths="22696,17243,14737,12966,12253,12065,11762,11762" videoProfile="high">
<Stream id="34540" streamType="1" default="1" codec="h264" index="0" bitrate="9888" language="English" languageTag="en" languageCode="eng" bitDepth="8" chromaLocation="left" chromaSubsampling="4:2:0" codedHeight="1040" codedWidth="1920" frameRate="23.976" hasScalingMatrix="0" height="1040" level="41" profile="high" refFrames="4" requiredBandwidths="21186,15735,13227,11457,10744,10555,10255,10255" scanType="progressive" width="1920" displayTitle="1080p (H.264)" extendedDisplayTitle="1080p (H.264)"> </Stream>
<Stream id="34541" streamType="2" selected="1" default="1" codec="dca" index="1" channels="6" bitrate="1509" language="English" languageTag="en" languageCode="eng" audioChannelLayout="5.1(side)" bitDepth="24" profile="dts" requiredBandwidths="1509,1509,1509,1509,1509,1509,1509,1509" samplingRate="48000" displayTitle="English (DTS 5.1)" extendedDisplayTitle="English (DTS 5.1)"> </Stream>
<Stream id="34542" streamType="3" codec="srt" index="2" bitrate="0" language="English" languageTag="en" languageCode="eng" requiredBandwidths="1,1,1,1,1,1,1,1" displayTitle="English (SRT)" extendedDisplayTitle="English (SRT)"> </Stream>
</Part>
</Media>

Just taking a shot in the dark here, is the movie 8GB in size? DTS audio from what I am to understand is pretty beefy audio, if the file itself is 8GB and your /tmp/ is 6GB you’re supposed to have 2x the space available for the size of the file being transcoded (so I’ve read).

May be nothing, may be something. Does the movie do this on your end if you try to replicate the problem?

Yeah the movie is ~7.7 GB.

So given a 4k movie with a size of 20GB, you would need 40GB of RAM to transcode without error? This seems a bit unreasonable as the end client doesn’t need the whole media upfront and should (I hope) transcode in segments.

Either way, in this instance, this seems a bit odd given it’s only audio transcoding and the issue is happening with the first minute or so of playback.

I was able to get the movie to transcode only audio by playing it locally through the web, however it was transcoding to AAC, not AC3 like above, and I was not able to reproduce the problem:
image

Thanks,
Josh

You don’t need RAM for transcoding - this is the case if you’ve created a RAM disk or something for your transcode temp directory. I personally have an NVMe SSD installed that is set up for my transcodes temp directory (250GB).

An unreasonable amount of RAM yes, but not HDD/SDD space which is the “recommended” temp transcode location.

And again, it was a shot in the dark.

Oct 17, 2022 03:01:29.990 [0x7f070b134b00] INFO - Plex Media Server v1.29.0.6244-819d3678c - Ubuntu PC x86_64 - build: linux-x86_64 debian - GMT -04:00
Oct 17, 2022 03:01:29.990 [0x7f070b134b00] INFO - Linux version: 20.04.5 LTS (Focal Fossa), language: en-US

A RAM disk is not needed by Plex for the transcoder directory. A hard drive or SSD will work fine.

You may want to use a RAM disk to save wear on an SSD.

You do not need to configure one separately. Ubuntu has one built in.

Set the transcoder temp directory to /dev/shm.

It defaults to using half the available memory. It exists only while the system is running and is re-created after a reboot.

If you still run out of memory when transcoding, then reconfigure to use an SSD or hard drive, where you’ll have more space.

You can see the low transcoder space warnings in Plex Media Server.log (rolls to .1.log to .5.log):

Oct 17, 2022 11:53:28.765 [0x7f070516ab00] WARN - [Req#97a3/Transcode/3kyvu4sc1pzy3rkiireeyfz1/ae8ea9bc-74f8-4d16-b311-8e3d31c9db35] Low disk space: 489.22MB source file, 6GB capacity, 99.77MB available on "/tmp/Transcode/Sessions/plex-transcode-3kyvu4sc1pzy3rkiireeyfz1-ae8ea9bc-74f8-4d16-b311-8e3d31c9db35"

FWIW, My system is an i5-10500T/Ubuntu 22.04/32GB RAM. I’ve had three remote users all transcoding video & audio and never run out of room on /dev/shm.

I understand, I wanted to avoid unnecessary wear on my NVMe SSD but I will probably end up switching back to using it.

I’m guessing since it is only transcoding audio the transcoder (assuming ffmpeg?) does this pretty fast and since the audio and video are in the same container it fills up the transcode directory pretty quickly. Although it’s weird I couldn’t reproduce it when transcoding to AAC instead of AC3.

I would think the transcoder throttle buffer would prevent this but maybe I’m not understanding that setting correctly.

Try /dev/shm first.

I am running Plex in an LXC on a proxmox host. I was originally using ‘/dev/shm’ and it ended up using half of my host machines RAM (host has 32GB). This causes issues if I provision the LXC with 8GB and it tries to use 16GB as the host will shutdown the Plex service if it uses more than is allotted to the container. That’s why I created a ‘/tmp’ tempfs dir with size 6GB to limit Plex from using up all 8GB of allocated RAM.

Gotcha. Wasn’t aware of that.

Thought you were running Plex “bare metal.” That’s why I mentioned /dev/shm.

Hopefully others can help. I’ve no experience with Proxmox, etc.

Definitely understand the desire to save wear on the SSD.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.