Really slow (sometimes fails) loading library for admin user

It’s been a few months now that I’ve noticed that on all my clients (Android app Pixel 6 Pro, Nvidia Shield, Apple TV 4K 3rd generation) the loading of certain TV shows takes a very long time, and sometimes (often) it just crashes, telling me that the library is empty.
And this only happens with the server admin user, with other users it’s blazing fast.

Any idea what the problem is?

@KoalaShady

Your network is flip-flopping all over the place.

Jul 07, 2023 17:55:04.077 [139846039219000] DEBUG - Network change.
Jul 07, 2023 17:55:04.077 [139846039219000] DEBUG - NetworkInterface: Notified of network changed (force=0)
Jul 07, 2023 17:55:04.078 [139846039219000] DEBUG - Network change notification but nothing changed.
Jul 07, 2023 17:55:04.239 [139846039219000] DEBUG - NetworkInterface: received Netlink message len=500, type=RTM_DELLINK, flags=0x0
Jul 07, 2023 17:55:04.239 [139846039219000] DEBUG - NetworkInterface: Netlink information message family=0, type=1, index=616, flags=0x1002, change=0xffffffff
Jul 07, 2023 17:55:04.251 [139846039219000] DEBUG - NetworkInterface: received Netlink message len=148, type=RTM_NEWLINK, flags=0x0
Jul 07, 2023 17:55:04.251 [139846039219000] DEBUG - NetworkInterface: Netlink information message family=7, type=1, index=617, flags=0x11043, change=0x0
Jul 07, 2023 17:55:04.251 [139846039219000] DEBUG - Network change.
Jul 07, 2023 17:55:04.251 [139846039219000] DEBUG - NetworkInterface: Notified of network changed (force=0)
Jul 07, 2023 17:55:04.251 [139846039219000] DEBUG - Network change notification but nothing changed.
Jul 07, 2023 17:55:04.251 [139846039219000] DEBUG - NetworkInterface: received Netlink message len=148, type=RTM_NEWLINK, flags=0x0
Jul 07, 2023 17:55:04.251 [139846039219000] DEBUG - NetworkInterface: Netlink information message family=7, type=1, index=617, flags=0x11043, change=0x0
Jul 07, 2023 17:55:04.251 [139846039219000] DEBUG - Network change.
Jul 07, 2023 17:55:04.251 [139846039219000] DEBUG - NetworkInterface: Notified of network changed (force=0)
Jul 07, 2023 17:55:04.252 [139846039219000] DEBUG - Network change notification but nothing changed.
Jul 07, 2023 17:55:04.252 [139846039219000] DEBUG - NetworkInterface: received Netlink message len=148, type=RTM_NEWLINK, flags=0x0
Jul 07, 2023 17:55:04.252 [139846039219000] DEBUG - NetworkInterface: Netlink information message family=7, type=1, index=617, flags=0x11043, change=0x0
Jul 07, 2023 17:55:04.252 [139846039219000] DEBUG - Network change.
Jul 07, 2023 17:55:04.252 [139846039219000] DEBUG - NetworkInterface: Notified of network changed (force=0)
Jul 07, 2023 17:55:04.252 [139846039219000] DEBUG - Network change notification but nothing changed.
Jul 07, 2023 17:55:04.252 [139846039219000] DEBUG - NetworkInterface: received Netlink message len=1108, type=RTM_NEWLINK, flags=0x0
Jul 07, 2023 17:55:04.252 [139846039219000] DEBUG - NetworkInterface: Netlink information message family=0, type=1, index=617, flags=0x11043, change=0x0
Jul 07, 2023 17:55:04.252 [139846039219000] DEBUG - Network change.
Jul 07, 2023 17:55:04.252 [139846039219000] DEBUG - NetworkInterface: Notified of netwo

Each ‘RTM_NEWLINK’ is it turning off and back on.

  1. Loose connector / broken connector or wire
  2. If WiFi (BAD DECISION) – signal coverage dropping.

Here you see the network connection failure cause the client player to be unjustly disconnected.

Jul 07, 2023 17:55:04.252 [139846039219000] DEBUG - NetworkInterface: Notified of network changed (force=0)
Jul 07, 2023 17:55:04.252 [139846039219000] DEBUG - Network change notification but nothing changed.
Jul 07, 2023 17:55:04.252 [139846039219000] DEBUG - NetworkInterface: received Netlink message len=1108, type=RTM_NEWLINK, flags=0x0
Jul 07, 2023 17:55:04.252 [139846039219000] DEBUG - NetworkInterface: Netlink information message family=0, type=1, index=617, flags=0x11043, change=0x0
Jul 07, 2023 17:55:04.252 [139846039219000] DEBUG - Network change.
Jul 07, 2023 17:55:04.252 [139846039219000] DEBUG - NetworkInterface: Notified of network changed (force=0)
Jul 07, 2023 17:55:04.252 [139846039219000] DEBUG - Network change notification but nothing changed.
Jul 07, 2023 17:55:05.846 [139846127418168] DEBUG - Using X-Forwarded-For: 91.175.18.2 as remote address
Jul 07, 2023 17:55:05.846 [139846127418168] DEBUG - Auth: authenticated user 31820090 as sylvain.m71
Jul 07, 2023 17:55:05.847 [139846075300664] DEBUG - Request: [192.168.1.45:40480 (WAN)] GET /library/parts/139677/1688424340/file.mkv?Accept=application%2Fjson&Accept-Language=fr (13 live) #5d1 Signed-in Token (sylvain.m71) (range: bytes=2273137706-) 
Jul 07, 2023 17:55:05.848 [139846125308728] DEBUG - Failed to stream media, client probably disconnected after 554608616 bytes: 104 - Connection reset by peer
Jul 07, 2023 17:55:05.848 [139846125308728] DEBUG - Completed after connection close: [192.168.1.45:40436] 206 GET /library/parts/139677/1688424340/file.mkv?Accept=application%2Fjson&Accept-Language=fr (13 live) #5a1 6233ms 554608616 bytes (range: bytes=2289725161-) 
```

Thanks for your reply @ChuckPa

I’m sorry, perhaps I didn’t prepare my first post properly.
Also, I just saw that in the logs you mentioned, someone other than me was using my Plex server during my test.

I tried to reproduce the test (making sure that nobody else was using it).
To give a little more detail, here’s what happened: I stopped the Plex server, then restarted it, then opened the Plex client (logged in with the admin user) on the Apple TV (connected via ethernet), then navigated to a TV show, displaying the season’s episodes took several long seconds (around 15 seconds).
(I should point out that this is also the case for all the TV shows in my library).
At this point I can see that my server’s CPU is running at around 100%.

I then changed user, navigated to the same TV show and the episodes were displayed almost instantaneously.

So to sum up, the problem I’m trying to solve is that browsing the TV shows in my library is extremely slow (sometimes buggy) with the admin user, but not with other users.

Interesting logs.

  1. You’re running a XPEnology box. The real DS3615xs has the Intel Core i3-4130 CPU

  2. The passmarks are only 3411 (low) and only marginally faster than the i3-4130
    The i3-4130 is actually faster per-core than the Xeon (which is typical)

https://www.cpubenchmark.net/cpu.php?cpu=Intel+Xeon+E3-1265L+%40+2.40GHz&id=2558

https://www.cpubenchmark.net/cpu.php?cpu=Intel+Core+i3-4130+@+3.40GHz

  1. Not knowing your hardware configuration (being XPEnology), the question of I/O performance comes into play.

My first question is: Have you optimized the databases ?

I have an Unofficial tool which optimizes the database in a way which PMS can’t.
It rebuilds the DBs in perfect packed & sequenced order with fresh indexes.

It’s had a profound impact on cases like yours.

If you’re willing and OK with the command line (SSH/Putty into the box), I recommend you give it a try.

Indeed, I forgot to detail the server hardware configuration, I’m sorry for that.

It’s an “HP ProLiant MicroServer Gen8” updated with an “Intel Xeon E3-1265L V2” processor (passmark 5022), “2 x 8 gb ECC 1600 mhz in dual channel” and “4 x Western Digital Red 4 To” in Synology Hybrid RAID, ext4.
It’s actually running Xpenology in BareMetal (it was my first NAS build a few years ago, today it’s a choice I regret and would like to switch to Unraid instead).

On the other hand, even if it’s not a very high-end NAS configuration, it works pretty well from what I’ve seen (apart from the problem mentioned).
On other users (even a “managed” user on the same client), it loads quickly and is capable of transcoding 4k SDR without a hitch.
Just for curiosity’s sake, what passmarks score would be acceptable?

Yes, I’m comfortable with the command line/ssh, I’m a developer.
I’ve already repaired the database several times following this guide: https://support.plex.tv/articles/repair-a-corrupted-database
Unfortunately, this did not solve the problem of slow library loading for the admin user.

If PlexDBRepair can do more or go further than the Repair a Corrupted Database guide, I’m willing to give it a try.

Anyway, thanks for your time in helping me, I really appreciate it :pray:

Hello, I try the PlexDBRepair with the “automatic” mode.

Here are the logs :

Enter command # -or- command name (4 char min) : 2
 
Automatic Check,Repair,Index started.

Checking the PMS databases
Check complete.  PMS main database is OK.
Check complete.  PMS blobs database is OK.

Exporting current databases using timestamp: 2023-07-18_18.40.56
Exporting Main DB
Exporting Blobs DB
Successfully exported the main and blobs databases.  Proceeding to import into new databases.
Importing Main DB.
Importing Blobs DB.
Successfully imported databases.
Verifying databases integrity after importing.
Verification complete.  PMS main database is OK.
Verification complete.  PMS blobs database is OK.
Saving current databases with '-BACKUP-2023-07-18_18.40.56'
Making repaired databases active
Repair complete. Please check your library settings and contents for completeness.
Recommend:  Scan Files and Refresh all metadata for each library section.

Backing up of databases
Backup current databases with '-BACKUP-2023-07-18_18.53.03' timestamp.
Reindexing main database
Reindexing main database successful.
Reindexing blobs database
Reindexing blobs database successful.
Reindex complete.
Automatic Check, Repair/optimize, & Index successful
2023-07-18 18.40.08 - ============================================================
2023-07-18 18.40.08 - Session start: Host is Synology (DSM 6)
2023-07-18 18.40.23 - Auto    - FAIL - PMS runnning
2023-07-18 18.40.56 - Auto    - START
2023-07-18 18.46.27 - Check   - Check com.plexapp.plugins.library.db - PASS
2023-07-18 18.46.35 - Check   - Check com.plexapp.plugins.library.blobs.db - PASS
2023-07-18 18.46.35 - Check   - PASS
2023-07-18 18.48.30 - Repair  - Export databases - PASS
2023-07-18 18.51.58 - Repair  - Import - PASS
2023-07-18 18.53.03 - Repair  - Verify main database - PASS (Size: 3615MB/3606MB).
2023-07-18 18.53.03 - Repair  - Verify blobs database - PASS (Size: 88MB/90MB).
2023-07-18 18.53.03 - Repair  - Move files - PASS
2023-07-18 18.53.03 - Repair  - PASS
2023-07-18 18.53.03 - Repair  - PASS
2023-07-18 18.53.12 - Reindex - MakeBackup com.plexapp.plugins.library.db - PASS
2023-07-18 18.53.12 - Reindex - MakeBackup com.plexapp.plugins.library.blobs.db - PASS
2023-07-18 18.53.12 - Reindex - MakeBackup - PASS
2023-07-18 18.54.47 - Reindex - Reindex: com.plexapp.plugins.library.db - PASS
2023-07-18 18.54.48 - Reindex - Reindex: com.plexapp.plugins.library.blobs.db - PASS
2023-07-18 18.54.48 - Reindex - PASS
2023-07-18 18.54.48 - Reindex - PASS
2023-07-18 18.54.48 - Auto    - COMPLETED
2023-07-18 18.55.32 - Start   - PASS
2023-07-18 18.56.10 - Exit    - Delete temp files.
2023-07-18 18.56.11 - Session end. Tue Jul 18 18:56:11 CEST 2023
2023-07-18 18.56.11 - ============================================================

I have the feeling that everything went smoothly.
And yet the problem of slowness for the admin user still persists.
Do you see anything else I could try?

That all looks good so far.

How many actual items are in the DB?

Is it slow for everyone to load or just a specific username?

If slow for just one, what’s unique? WiFi / LTE / device ?

I have 660 movies, 52 TV shows with 1302 episodes

It’s slow for a single user (KoalaShady), especially when displaying a TV show or season (I don’t think there’s any problem with the movies)

And the problem is present on all clients (Apple TV 4K 3rd generation wired Gigabit Ethernet, Nvidia Shield wifi, Android app on Pixel 6 Pro wifi or LTE)

On these same clients, as soon as I change user, no more problems

Hello, I still have this problem on my account, in the meantime I’m using a managed account but I’d love to finally be able to use my administrator account again.
Is there anything else I can do? Any other details?

@KoalaShady

I’m sorry I didn’t get notified until now.

Quick question:

  1. The CPU in your machine is E3-1265L. The default CPU in a DS3615xs is an Intel Core i3-4130

  2. How much memory is in the machine?

  3. Storage is HDD or SSD?

No worries, thank you for your response.

For the hardware configuration :

It’s an “HP ProLiant MicroServer Gen8” updated with an “Intel Xeon E3-1265L V2” processor (passmark 5022)

“2 x 8 gb ECC 1600 mhz in dual channel”

And “4 x Western Digital Red 4 To” in Synology Hybrid RAID, ext4

It’s running Xpenology in BareMetal

Thanks for confirming XPEnology. Knew it couldn’t be a stock box.

I’m going to ask you to download and run my tool again.

Specific commands:

  1. STOP (and confirm PMS is stopped)
  2. AUTO (let it export import and reindex
  3. START

There’s no reason the ‘admin’ user should be slow. The database doesn’t care about the username accessing it

Yes, you were right, but I had already mentioned it a few posts earlier

I’ve already run your tool with exactly these commands, but I can do it again

And yes, I know that the database doesn’t care who accesses it (like I said a few posts ago, I’m a Senior Software Engineer)

I was thinking more of an index problem or a very specific user configuration, like language or subtitle preferences

As a reminder, the problem is only present when I click on a TV show or a season of a TV show
For movies, no problem

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