Transcoding Throttle Removal Problems - An Example

Server Version#: 1.41.4.9399
Player Version#: Plex for Samsung 5.90.1

My server is Ubuntu with Plex installed on bare metal with the default transcode location. We started a 4K DV HDR10 movie with 7.1 TrueHD (over 80GB total filesize) on a Tizen 4K TV with just the TV speakers. The TV can direct play/stream the video, but the audio has to be transcoded into a compatible format in a whole new container. So this means the transcoded stream grows to nearly the same size as the original file in the transcode directory.

Before this update, the transcode was throttled so while the directory would fill up, it did it fairly slowly, meaning Plex makes note of the low disk space and recovers as the player consumes previously transcoded ranges. With this update, the transcode directory fills up much faster (since it isn’t throttled), which leads to a ton of “out of space” log errors that seem to keep Plex from fully recovering and the client stream ends up dying. I rolled back to the previous version to test the same movie and it played through fine (even though the directory still fills up, it just has time to recover the space). I was testing using the movie half complete, but the transcode directory was over 37GB (the free space I typically have on the base OS).

Just to get it working again I created a new NFS mount on my NAS, so space isn’t as concerning while I sort this out.

I tested /dev/shm but no dice. Like I said I’m limited to 8GB of RAM (which looks like Plex reports as 3.73GB), which filled up in the first few minutes of playback as transcoding ran way ahead (>10% for the first 1% of playback). The log was slammed with Low disk space: 0B source file, 3.73GB capacity, 0B available on "/dev/shm/PlexCache/Transcode/Sessions/plex-transcode-.... The real problem is that Plex runs ahead creating these files, but they’re empty, so the client eventually starts asking for ranges that haven’t actually been transcoded: Overzealous client asked for end range of 1047499, content size is 765; we'll clip. and Range could not be satisfied 1047000 - 764 (total size=765) which appears as just buffering to the client indefinitely. Hazarding a guess, the client isn’t progressing through the movie fast enough for Plex to be able to clear out transcode data as it moves along? I’m not sure how much ACKing there is as clients ask for ranges from the server so that’s definitely me guessing.

So I guess I have to keep it on the NAS mount for now since that’s the only location that has the amount of space needed in my setup. Like I said, this is probably kind of an extreme example (UHD file on a constrained resource system), but this isn’t a great change for my setup. Would be great if Plex moved this from a change to an option or something rather than just flipping the switch for everyone. Another option, since you seem to be monitoring available space in the transcoder directory already, would be to reintroduce throttling when some percentage of the space is consumed that is possibly configurable on the server.

The weird thing in all this: my example isn’t even technically hardware transcoding from what I can tell. No (hw) on Tautulli or Plex Activity and intel_gpu_top doesn’t show any activity, but it has definitely stopped throttling on this test from 1.41.3 to 1.41.4.

Having similar problems here: I had an 8gb transcode partition, and plex just fills it up now and then crashes.
I’ve expanded it to 16gb for now to try and regain some stability but this change is stupid.

No more RAM drives.

That’s why i’m staying on the latest public release for now. The removal of throttling on HW Transcodes is a terrible idea, especially as they haven’t given a technical reason for it either.

3 Likes

May I please ask for anyone who has this, and can capture/recreate this, to attach the log files AFTER PMS crashes ?

I will do my best here to recreate it.

Between your logs and mine, I’ll have enough to go to Engineering and get it fixed

ALL:

I’ve recreated the issue with 1.41.4.

Please revert to Public 1.41.3 for now

1 Like

This is more a problem for servers with lower ram availability. It would be great to have this as a toggle option, as ive realised its kind of of great to be able to smash out the transcode if required at the beginning of the playback! I believe this is how Jellyfin/Emby works.

@kerbys

I have already reproduced this.

For now, you have TWO options:

  1. Use Public 1.41.3 where the throttle works.
  2. Use BETA -AND- a hard drive or the default transcoder TMP for the system.
1 Like

Not trying to be rude, but genuinely curious what the intention was behind this change. What is the purpose of not allowing transcodes buffer to be throttled? I imagine you guys had to have chosen to do this for a reason.

I’m not certain it’s deliberate.
This has all the symptoms of an unexpected outcome from something non-related.

I’m normally in sync with PMS releases.
It was only after this issue was raised did I get involved.

Tracing the logs as it runs looks very much like a bug to me and why I submitted it to engineering as such.

Thought this was related to the fix listed on the PMS update here

“(Transcoder) Don’t throttle hardware transcodes (PM-2238)”

Are these 2 are not related?

2 Likes

The change is in the release notes for this version:

  • (Transcoder) Don’t throttle hardware transcodes (PM-2238)
1 Like

My mistake.

Thanks for pointing that out.
I did miss the team meeting.

I will discuss with Engineering about reconsidering what’s been done.

1 Like

From what I can tell the issue isn’t directly related to using a RAM disk or /dev/shm, it’s just more apparent there because that’s typically where space is most limited.

The issue I’m experiencing is that without throttling, wherever the transcode directory is located can run out of (purgable) space.

I tested this scenario again to get some better numbers (LG TV this time, but still with TV speakers to audio-only transcode). I have about 37GB of free space on my root drive, where the transcoding defaults to. I started playing the movie, which has a runtime a hair over 3 hours. I got about 11 minutes into playing (about 6% progress) until the hard drive was completely full, and according to Tautulli the movie has been around 55% transcoded (the transcode rate was running between 7-10x). I had terminals open watching Plex Media Server logs and checking the oldest files in the Session folder. As the “low space” messages started coming in, the oldest files were being deleted as expected, deleting ranges that had already been played. However, eventually (about a minute later) the need for space overran the ability to delete ranges and the stream crashed on the LG client accompanied by writing error logs: Jan 26, 2025 19:14:00.990 [123167863483192] ERROR - [Req#22fc7f/Transcode/dqbqvj5ja9teqw9eih3r6l3u/3eb612a1-1df5-46f6-9a44-1037317c1ce0] Error writing trailer of media-%05d.ts: No space left on device.

This is one stream on >30GB of free space and it cannot fully play through, so it could likely be worse for servers with more users.

I’m not sure it would be wise to simply remove throttling completely as there obviously needs to be some safeguard to check for transcode growth rate against usable storage and purgable range for however many streams are currently running, else this is just an unavoidable scenario, likely increasingly so as more libraries expand their 4K offerings.

5 Likes

Agreed. This isn’t just a problem for RAM drives. Those using a small SSD for transcodes can run into the same issue.

Thanks, Chuck, for looking into this. It seems like an odd design choice.

1 Like

Oh im not complaining! I have alot of ram, its kinda nice to see it being used! Jellyfin has an option to turn this on or off, so would be nice to have an option to leave this on, however on a bug level the transcode buffer should respect the option of “Transcode default throttle buffer” for those with smaller RAM disks.

1 Like

That’s my issue - my SSD partition was 8GB, now 16 - probably smaller than some people’s ram drives! :slight_smile:
But the problem would likely exhibit itself whenever if you had limited space so that’s probably the key. Personally, I like setting say 10 minutes of max transcode - that seems reasonable enough that a user won’t have a problem. Unlimited seems pointless to be but what do I know?

If this isn’t fixed it will drastically reduce the number of simultaneous streams that can be concurrently watched. NVENC/QS etc all have a limited number of FPS that can be transcoded at once, so if that is being spent on content that is many minutes away from being watched then it will limit the speed of other more relevant encoding jobs.

In addition, some types of hw transcodes also use a lot of CPU resources at the same time for audio (e.g. truehd 7.1 down to aac 5.1) which could mean the system is way overloaded transcoding far beyond what the user is watching, wasting energy and slowing down the entire server.

2 Likes

Yeah imagine just transcoding audio for three different remuxes at the same time. That is potentially 200GB of space used for roughly 65-70GB remuxes. Before using a RAM drive I was using a 256GB SSD for AppData and transcodes and AppData took 100GB of it so I couldn’t have managed even then.

1 Like

It’s not just that it will take up space but it will take up transcoding GPU/CPU resources as well. I mean, what’s the point of transcoding a 2-hour movie if the viewer is only gonna watch 5 minutes of it?

1 Like