Apple TV app causing high CPU load on server

If there are subtitles in the file, you must be very careful with the properties flags.

  1. Forced subs must be marked ONLY as forced.
  2. If those subtitles are PGS, and the audio doesn’t need transcoding, it will direct Play. Observe -
    Screenshot from 2021-12-09 16-45-44

If you look at my server, there is no transcoder

chuck@papyplex:~$ ps -ef | grep -i trans
chuck     570969  570952  0 16:47 pts/0    00:00:00 grep --color=auto -i trans
chuck@papyplex:~$ 

What I’m suggesting here is media curation.

Can you please show me the ‘mediainfo’ output of a file causing this ?

I can’t, sry. I already told you that this problem isn’t related to specific files. It just happens now and then after a while. I can play the same file totally fine after I force closed the Plex App before. It also happens sometimes when no file is playing at all.

I’ve never had subtitles enabled whenever this problem occurred.

There is kind of a “pattern”: After a few days the Plex App is getting slower and slower. Loading metadata took quite a while and the CPU is running at 100% until everything’s loaded. Especially opening some tv series is horrible slow and cpu-heavy then. Randomly, the playback will then start do buffer a few times and CPU is stuck at 100% until i force close the Plex App again. After reopening it, everythings back to normal for the next few days.

Please do the following.

  1. Settings - Server - General - Show Advanced
  2. Make certain DEBUG is checked
  3. Make certain VERBOSE is NOT checked
  4. Click SAVE if you made changes

Now, the next time it does this, Immediately Settings - Server - Troubleshooting - Download Logs.

Attach the ZIP file.

Maybe I will catch it at whatever is happening.

These are the log files the last time it happend.

Plex Media Server Logs_2021-12-01_19-41-01.zip (4.0 MB)

@Tommy_Hewitt

The one thing I do see is repeated playback of this:

Dec 01, 2021 17:08:21.478 [0x7f668d2edb38] DEBUG - Play progress on 13364 'Mein Kummer' - got played 300560 ms by account 1!

Is this intentional ?

@ChuckPa To be honest, I don’t know anymore. Could’ve been me testing something.

That’s fine.

Did you recently add a lot of new media ?

Asking because of

  • Music gets “Acoustic Analysis” during maintenance
  • Episodes get “Intro Detection” during maintenance and when added.

If there is no analysis for a title being played, PMS will be very conservative and usually use much more CPU than it needs.

Asking again –

May I see the XML or the media info for one of the titles which causes this CPU usage ?

@ChuckPa Added a few series over the last few weeks. But everything’s run through analysis already. The high CPU load does not start immediately with the playback. It always starts somewhere in the middle of the movie/series.

And there is no title that causes high CPU usage per se. I can’t reproduce it with the same title a second time. It just occurs completely randomly.

Anyway, here’s another XML from the episode it happens the last time:

13364.xml.zip (3.0 KB)

Regardless of the playback problems, there is also the high CPU load when loading metadata. I’ll try to record it the next time it starts to occur.

That is bizarre. nothing there to cause high load.

Next time this happens, please open Resource Monitor → processes.

See who is causing the load

@ChuckPa

Posted a screenshot of the resource monitor in post #5 on Nov 11th here. It only shows Plex Media Server as the culprit.

This problem is super strange, yes. I don’t think that the cause has something to do with playback at all.

A while ago I kept the Apple TV just open within the main menu and was watching something on my MacBook. The CPU ramped up to 100% suddenly and only closing the Apple TV app stopped it.

This is still an issue with the latest server update. Plex suddenly needs 2GB of RAM and non stop 5000 IOPS of disk read and write until server becoming unresponsive. Nothing in logs.

Server (docker on debian): 1.25.2.5319
tvOS Client: 7.26 (1744)

Downgrading is the only way to fix it.

@Tommy_Hewitt

100% CPU on a Synology “screams” of a subtitle problem OR analysis.

What is Plex showing you in the resource field ?

Even in this screenshot, you can see the CPU spike as Plex loads the posters for all the movies in my Movies library. This is normal.

The green line is PMS accounting for its activities.
The red line is for everthing else.

What do you see?

I wonder if this might not be a case where PMS, which “ok” (not great, just “ok”) with 1GB does a lot better with 4+ where 8GB is best for transcoding of Audio & Video of multiple concurrent streams (2-4)

@itsnotv

There have been database changes.

Which version did you downgrade to?

If you downgraded below 1.24.5.5173 then
your downgrading only hastens the eventual need to ‘bite the bullet’.

Spread over the next few versions are continued refinements to the data stored.

PMS will work its way through your entire library (eventually)

NOTE: You’re referring to Docker on Debian. This is the native Synology app. These are two vastly different platforms.

I downgraded to 1.24.2.4973 which is solid stable. I could easily reproduce this issue in every update after this.

I did not notice any abnormal startup times. I would update and let it run for a new hours. I had no issues with other clients (web, android), but when I play something on my Apple TV, then the server would get unresponsive.

I understand, something has changed on the server that introduced this issue with only Apple TV clients. I guess it affects all server versions.

@itsnotv

What I’m perplexed about is – I can’t recreate it!

I am using stock PMS on the DS418 (plexpass and/or public)
I am using the public AppleTV app.

I’m going to attempt another deep-dive in @Tommy_Hewitt logs
:crossed_fingers: I find somethng.

@itsnotv

@Tommy_Hewitt

Which view causes this in the AppleTV app?

Are you sitting at server selection?
Are you loading a particular Library section? If so, how many titles are in the secton ?

Right after I start playback or seek within a movie. I have never seen browsing trigger it.

Library size doesn’t matter, I was able to reproduce this with a library of 30 and also with a size of 1000.

I have noticed this for the last 3 months or so.

It is infuriating. Plex blows up the CPU to 100% such that no one can even direct stream anything.

It’s not subtitles. It’s not music scans. It’s not scheduled tasks. It’s not adding lots of new media.

If it is specific to AppleTV I think it must be that the Apple TV is sending hideously inefficient requests to the Plex server.

I will have time this weekend to work on this .

Applogies for the delay (CRAZY busy week)

ALL:

I tried to replicated this for almost a full hour and cannot.

You do realize, right after you start a movie, the transcoder is going to run at full-speed (if it has to) to be invoked ?

If you’re showing 100% of a Synology CPU, you MUST be burning subtitles if it’s an x86_64 or it’s just filling the buffer if an ARMv7 / ARMv8 CPU

Is this true?

GIven you can reproduce this,

  1. Settings - Server - General - Show Advanced
    – DEBUG logging enabled
    – VERBOSE logging disabled
    – SAVE button if you make changes

  2. Start the playback

  3. Reproduce the condition

  4. Stop the playback

  5. Wait 20 seconds for buffers to flush

  6. Download the logs ZIP file

  7. Please attach for review.