Server performance quickly degrades over time

Doing my part to not be DenverCoder9 :saluting_face:

I reported the issue to PlexAPI as well but they closed it Random X-Plex-Client-Identifier Causes Performance Issues on PMS · Issue #1532 · pushingkarmaorg/python-plexapi · GitHub

Never got anyone to bite from the Plex side either, the server should ultimately stop this from happening. The client behavior is triggering the bug, not causing it.

@ChuckPa now that we have proof that multiple people are getting hit by this behavior I really hope you or someone else on the server side can take a look, thank you :person_bowing:

1 Like

So, I am not running on docker but in a Proxmox LXC and I am experiencing similar behaviour, progressively increased CPU usage to the point where there is a steady cycle of max usage of 1 CPU core every ~2 minutes whether users are streaming content or not. Only resolution is to restart. I am hoping this is something that is actively being worked because it’s causing serious usability issues, not to mention a bunch of unnecessary CPU cycles.

Below is the CPU usage over the last hour, before and after a restart. The system was idle during this time, no users streaming media. I suspect left as is it will be peaking at ~20-25% tomorrow on a regular cycle (4 core LXC). You can see after the restart it starting to creep up again, although no one is using the system. I’ve never seen this before and have been running happily in an LXC for 2+ years. Looking at historical data, I agree with @StoneColeQ that it’s around mid August where things started to change.

Sorry for the delay. Real-life issues took priority.

I still cannot replicate this issue.

root@pve:~# clear ; uptime ; dpkg -l | grep plexm
23:55:31 up 44 days, 14 min,  1 user,  load average: 0.07, 0.09, 0.30
ii  plexmediaserver                      1.42.2.10156-f737b826c              amd64        Plex organizes all of your personal media so you can easily access and enjoy it.
root@pve:~# cat /proc/cpuinfo | grep -i 'model name'
model name      : Intel(R) N100
model name      : Intel(R) N100
model name      : Intel(R) N100
model name      : Intel(R) N100
root@pve:~# 

I am able to replicate it 100% of the time on multiple systems on multiple different networks using the steps outlined here. The only variable I didn’t test was a different account. Are you using my docker run command and python script?

I have not had any issues since locking the X-Plex-Client-Identifier though I’m still restarting daily.

@StoneColeQ

This third party python app is what’s triggering the problem?

OR

Setting the variable is the root cause ?

X_PLEX_IDENTIFIER = CONFIG.get('header.identifier', str(hex(getnode())))

The root cause is the identifier changing. Anything that makes any request to Plex will trigger the issue if Plex sees too many unique identifiers. We can ignore the python library, this the MRE:

If I’m getting it now,

Too many client identifiers == too many clients == ToS (commercial use violation) detection being triggered.

If this is the case (too many client identifers) then asking for remediation will be a flat out "no.

That can’t be what’s happening. The CPU usage spikes to 100% for longer and longer. If it was ToS why not stop the streams or stop the server. Also this is for any API usage, not from playing streams.

@StoneColeQ

I spoke with one of the employees about what’s happening.

His feedback:

  1. “PlexAPI” is not maintained by Plex. Suggest you contact the author to resolve that problem.

  2. Logging in with random Client IDs again and again should be avoided – regardless if PMS chokes or not.

  3. We don’t see any resource leaks in the logs

  4. He does see you cleaning up the client devices (every day??).
    Perhaps start turning off other third party apps one by one until the problem app is identified then contact that author and report the issue..

It really feels like I’m talking into the void, I simply do not understand. Why am I getting these generic responses after spending hours diagnosing and managed to identify the root cause? At least I was able to mitigate the issue and have been running the past week with no issues. Sounds like there is no interest in fixing this bug so I guess there is no point in continuing.

From my understanding of the issue, it should be fixed automatically on python versions 3.14 and 3.13.6+ from this:

Can you try either of those and see if the issue is still reproducible?

From my understanding of the issue, it should be fixed automatically on python versions 3.14 and 3.13.6+

Python has nothing to do with this bug. I’ve already showcased it with my MRE, any request to Plex’s API triggers this. Let me state it plainly:

It is absurd for Plex to pin my CPU to 100% and become completely unusable simply because it sees a few unique strings over a couple hours. It doesn’t matter what creates the unique strings, the program shouldn’t have a meltdown over it. This cannot be the intended behavior of a well designed program.

Yeah, I am not defending Plex here. This is a genuine bug but given so few reports, I would guess it’s not very high on their priority list.

The upgrade in Python version was just mentioned because PlexAPI is probably the most widely used third-party client and it’s in python, at least it should automatically get fixed with newer versions.

1 Like