Skip to content

Improve test used to determine if user can connect to plex server to reduce CPU usage #11

@phobiac

Description

@phobiac

Describe the bug
This is an old issue and I originally reported it here but I'm copying that information over.

The theory from that error report was that the currently used connection test which calls plex.library.sections() for each user is CPU intensive. It may actually be as simple as the retry logic being too aggressive? Regardless my testing showed that it's this check which is being repeated that was spiking CPU usage on my end.

To Reproduce
I'm not sure how exactly to reproduce it, but I have this issue come up frequently enough with my users that I can at least test potential fixes...

Expected behavior
A more graceful failure if the connection fails that doesn't spike CPU usage.

Actual Behavior
Repeated attempts to perform the test that cause high CPU usage.

Environment Details

  • Plex Auto Languages Version: journeyover/plex-auto-languages:main (pulled today to check)
  • Plex Server Version: 1.41.3.9314
  • Operating System (if applicable): Debian Linux
  • Deployment Method (if applicable): Docker

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcannot reproduceI'm unable to reproduce this issue with the information providedhelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions