Getting frustrated with local & remote buffering after new hard drives & new computer build last yea

Server Version#: 1.40.4.8679
Player Version#:
<If providing server logs please do NOT turn on verbose logging, only debug logging should be enabled>

Hey everyone, I’m trying to figure out why my server is buffering on local and remote streams, when all my stuff is hardwired and direct playing.

Upgrades last year

  • moved my plex server to an Dell Optiplex 3050 system with and i7-7700T, 16GB Ram, 256GB SSD running ubuntu 2.2.04 LTS. (Old server was HP 290 with G4900 running Ubuntu 18 LTS for 5+ years with no issues). Using quick sync
  • Upgraded my Synology DS1815+ from version 6 to 7
  • replaced my old (8) 5TB HGST drives with (5) 18TB Red Pro Nas & (3) 14TB chucked drives ( these shucked could have something to do with my issues as I get this warning now & again, “The system detected an I/O command timeout, but it can still work properly and continue monitoring this drive.”) The hard drives are not set up to sleep.

List of issues going on

  • Whenever i run a library scan, my streams, local and remote, DirectPlay and transcode will buffer randomly while scanning my library
  • on my nvidia shield when going to a movie page, it will spin & spin until it says “something went wrong” and I get a retry option, at which point I can click on it and it will work
  • sometimes on my nvidia shield, a movie will buffering every 5-10 minutes.

I have deleted and reinstalled the Plex apps on the various devices with no solution. I have run the Plex database repair tool. I have tried different ethernet cables but so far, not able to figure out why it’s buffering.

Everything is hardwired 1Gbps and my internet speeds 1Gbps up and download, (fiber)

I’m not sure which of my upgrades last year is causing my set up to buffer but can anyone any suggestions to try?

I downloaded my logs but is there any identifying information in there that I can remove before I upload them?

I’ll be direct. (apologies for how I may sound. It’s not intended as such)

Shucked drives in a NAS are a recipe for disaster.

  1. They aren’t NAS-grade drives. They don’t have TLER (Time Limited Error Recovery) nor can they handle the vibration of other drives in close proximity.
  2. Shucked drives are the cheapest thing the drive manufacturer has. They are not meant for high volume usage. They’re almost always meant for low volume desktop use.
  3. They’re usually refurbished drives.

Command I/O timeout

The drive was given and command and it didn’t respond.

  1. It’s either stuck on a bad sector (NOT what you do in a NAS)
    -or-
  2. The mechanical is faulty.

Do you have one Plex server (on Linux) with data on the Syno and use the shield as the player

-or-

Do you have 3 distinct servers (Linux, Syno, and Nvidia) ?
Where is the timeout? Linux or Syno?

About to go offline for the night. I’ll be back in the AM but wanted to reply before I did.

1 Like

I would start by doing a test that removes the NAS from the equation. Create a new media library on the server’s SSD. Put in a few files. See if performance when playing from that library is any better. If so, then you know the problem is something about the NAS or the server’s connection to the NAS. (I assume that is where your media files are, right?)

If the local library is no better, then you know you’re having some kind of problem with the server or the LAN.

Yeah, need to know this for sure, I am making some assumptions.

Hey Chuck, no need for apologies, direct is best and thank you for your help.

Yea, the drives give me pause because only these 3 are giving the I/O timeout warning, but only a few times a month. They were brand new drives and fully tested sector by sector.

Everything that others have said related to the model I am using, WD EasyStore 14TB WDBAMA0140HBK, is that they are white label red drives. Others have said they are running them in their synology nas with no issues with plex.

Before I drop money to buy 3 more Red Pro Nas drives, I wanted to check here with the experts if there is anything else I can try. I ran speed tests to the Nas, 900 Mbps up/down and read/write speeds are around 90-100MB/sec.

I have 1 Plex server on my i7 computer where all the Plex magic happens. The Synology NAS houses all my media and connected to the Plex Server via SMB 1Gbps network connection. The nvida shield is my client along with an apple tv, both of which buffer.

Thanks again for your feedback

Hey Banzailnstitute,

Thanks, that’s a great suggestion and something try out to remove the NAS from the equation.

My plex server is on the i7 computer, Synology houses my media, and one of my clients is the nvidia shield along with apple tv, both of which locally buffer.

Just a quick thing to check on anything that is running Linux. See that vm.swappiness is set to zero. Swapping is the devil and linux likes to swap even if you have tons of ram, depending on this setting. Leaving it at zero will allow for swap to prevent an OOM crash only. I have seen myriad issues attributed to various aspects of IO fixed by this simple setting.

To check:

sysctl vm.swappiness

If it is not ‘0’, then do:

sysctl -w vm.swappiness=0

and then add an entry in /etc/sysctl.conf

vm.swappiness = 0

Just my $0.02. YMMV. IANAL. XYZ PDQ.

Hey obumbratum,

So when I made this thread, I also disabled IPv6 on my server, but also confirmed it was already disabled on my NAS and my router itself.

Since disabling it on the Plex server itself, I have noticed that I am not getting as frequent buffering when my library scans.

I still get the random error message when I click on a movie and wait for it’s details to load, and then click retry at which point it connects right away.

I have talked to 1 PS5 user that randomly gets a quick microsecond buttering where they see the yellow spinning signal for a fraction of a second.

Now onto your suggestion for the swap, let me first say that I know next to nothing about Linux, so please treat me like a novice in this regard.

I ran the first check and it returned a value of 60

Before I do parts 2 and 3, regarding part 3, I have the text file open in ready only, but I can use
Sudo gedit /etc/sysctl.conf to open and edit it right?

When I open the file, where should I input that entry you advised me to input?

A few additional comments,

When my library scans, I get a ton of, which I dont think I get if my library is not scanning

  • SLOW QUERY: It took XXXX.000000 ms to retrieve XXX item
  • QueryParser: Invalid field ‘pinnedContentDirectoryID’ found, ignoring.
  • QueryParser: Invalid field ‘contentDirectoryID’ found, ignoring.

as well as a warning

  • Held transaction for too long (/home/runner/actions-runner/_work/plex-media-server/plex-media-server/Library/MetadataCollection.cpp:525): 0.120000 seconds

There’s a lot of kernel tuning going on here which should not be happening.

The most folks need to do is increase the inotify slot max in almost all cases.

Might it be possible to see:

  1. DEBUG logs of a session which does exhibit this stuttering?
  2. Results of an iperf3 test between the two points, showing both forward and reverse (-R) direction?

In light of the post directly above this, I NEED log ZIP (will arrange PM if needed)

Slow Query is database fragmentation – easily fixed.
Held transaction too long is the direct result of that slow query.

QueryParser should be ignored. It’s work Engineering is doing.

1 Like

Hey Chuck,
Thanks for the suggestions.

Not sure what inotify slot max is but I will google and see if I can get it to help me.

I will work on figuring out and getting you the iperfc test as well as logs, once I get those figured out, I will reply so I can send them to you directly versus posting them here.

Regarding the slow query database fragmentation, I have ran that databases corruption tool and I have nightly schedule task to optimize. Not sure if either of those would fix the fragmentation.

Thanks again for your help

Increase the number of directories Linux can monitor (inotify) for PMS

1 Like

This is iperf3 output.

Normally, you will get full wire speed on both.
At this very moment, my NAS is making a new, full, backup on the backup NAS
(I fat-fingered the backup NAS and had to make fresh) so you do see the los of performance. The retries shows the network contention. Iperf3 notifies you of everything less than perfection. None of this would impact playback but you still see it on iperf. If it dropped to Megabits – THAT would be a problem.

[chuck@lizum ~.2004]$ iperf3 -c 192.168.0.20
Connecting to host 192.168.0.20, port 5201
[  5] local 192.168.0.13 port 42088 connected to 192.168.0.20 port 5201
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-1.00   sec  1.09 GBytes  9.39 Gbits/sec    0   1.90 MBytes       
[  5]   1.00-2.00   sec  1.09 GBytes  9.40 Gbits/sec  795   1.42 MBytes       
[  5]   2.00-3.00   sec  1.10 GBytes  9.41 Gbits/sec    0   1.57 MBytes       
[  5]   3.00-4.00   sec  1.09 GBytes  9.40 Gbits/sec    0   1.68 MBytes       
[  5]   4.00-5.00   sec  1.09 GBytes  9.39 Gbits/sec  694   1.36 MBytes       
[  5]   5.00-6.00   sec  1.08 GBytes  9.28 Gbits/sec  527   1.11 MBytes       
[  5]   6.00-7.00   sec  1.09 GBytes  9.34 Gbits/sec  706   1024 KBytes       
[  5]   7.00-8.00   sec  1.08 GBytes  9.24 Gbits/sec  312   1.27 MBytes       
[  5]   8.00-9.00   sec  1.09 GBytes  9.34 Gbits/sec  517   1.03 MBytes       
[  5]   9.00-10.00  sec  1.09 GBytes  9.40 Gbits/sec  433   1.09 MBytes       
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.00  sec  10.9 GBytes  9.36 Gbits/sec  3984             sender
[  5]   0.00-10.04  sec  10.9 GBytes  9.32 Gbits/sec                  receiver

iperf Done.
[chuck@lizum ~.2005]$ iperf3 -c 192.168.0.20 -R
Connecting to host 192.168.0.20, port 5201
Reverse mode, remote host 192.168.0.20 is sending
[  5] local 192.168.0.13 port 48208 connected to 192.168.0.20 port 5201
[ ID] Interval           Transfer     Bitrate
[  5]   0.00-1.00   sec   770 MBytes  6.46 Gbits/sec                  
[  5]   1.00-2.00   sec   561 MBytes  4.71 Gbits/sec                  
[  5]   2.00-3.00   sec   436 MBytes  3.66 Gbits/sec                  
[  5]   3.00-4.00   sec   558 MBytes  4.68 Gbits/sec                  
[  5]   4.00-5.00   sec   561 MBytes  4.71 Gbits/sec                  
[  5]   5.00-6.00   sec   561 MBytes  4.71 Gbits/sec                  
[  5]   6.00-7.00   sec   553 MBytes  4.64 Gbits/sec                  
[  5]   7.00-8.00   sec   561 MBytes  4.71 Gbits/sec                  
[  5]   8.00-9.00   sec   561 MBytes  4.71 Gbits/sec                  
[  5]   9.00-10.00  sec   561 MBytes  4.71 Gbits/sec                  
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.04  sec  5.55 GBytes  4.75 Gbits/sec  529             sender
[  5]   0.00-10.00  sec  5.55 GBytes  4.77 Gbits/sec                  receiver

iperf Done.
[chuck@lizum ~.2006]$

For your test:

  1. Port forward WAN port 5201 to your local 5201 where iperf3 is running
  2. On your machine, start iperf3 -s (server mode). You’ll see all the tests as they run on the command line.
  3. Have each person, in turn, iperf3 -c your.wan.ip.addr and then repeat with -R added on the end like I did. (the -R result is what they see coming from you)
1 Like

Figured I’d give you this for when you get back.

From your Linux command line, on the machine where the server is running,
(I presume you’re running the native app on Ubuntu 18)

Give this a spin. It will definitely put the DB in order.
BE PATIENT with it . It will not hang (unless your machine is faulty)

It gives the DB a good check, then exports the DB (in sorted order), imports it back in (resulting in a perfect ordered DB). It then recreates search indexes for that new DB.

It just goes fast :racehorse: lol

it’ll do other cleanup for you (prune command)

Give the README a good going over and look at the sample sessions.

Suggested commands:

sudo DBRepair.sh  stop auto start exit

Hey Chucka,

Thank for your messages, I will spend time this week testing out those things, as I learn how to use the tools.

So regarding Database Repair utility. I’ve actually used this tool a handful of times already on my database, but am still getting those warnings I mentioned above in another response. I am on Ubuntu 22.04.4 LTS with Plex server installed using the downloaded file from the Plex website. I used this command to run the tool, which i think is the recommendation,
“sudo ./DBRepair.sh stop auto start exit”

Should this utility have corrected those “Slow Query” warnings?

My utility ( DBRepair ) takes the DB and puts it in the best order it can be.
All the tables in the DB are contiguous again (Adding media fragments them).

Dumping it all out then rebuilding (sequentially) is just like reloading a HDD sequentially.

You’ll see the improvement.

Here’s what it looks like, live, on my machine.
I have customized the server config (override.conf) to move the APP_SUPP_DIR

[chuck@glockner plexmediaserver.2004]$ pwd
/vol/plexmediaserver
[chuck@glockner plexmediaserver.2005]$ sudo /vmssd/git/chuck/PlexDBRepair/DBRepair.sh stop auto start exit
 
 
 
      Plex Media Server Database Repair Utility (Ubuntu 22.04.4 LTS)
                       Version v1.07.00
 
 
[2024-08-05 02.18.22] Stopping PMS.
[2024-08-05 02.18.22] Stopped PMS.
 
[2024-08-05 02.18.22] Automatic Check,Repair,Index started.
[2024-08-05 02.18.22] 
[2024-08-05 02.18.22] Checking the PMS databases
[2024-08-05 02.27.35] Check complete.  PMS main database is OK.
[2024-08-05 02.27.35] Check complete.  PMS blobs database is OK.
[2024-08-05 02.27.35] 
[2024-08-05 02.27.35] Exporting current databases using timestamp: 2024-08-05_02.18.22
[2024-08-05 02.27.35] Exporting Main DB
[2024-08-05 02.27.47] Exporting Blobs DB
[2024-08-05 02.27.48] Successfully exported the main and blobs databases.
[2024-08-05 02.27.48] Start importing into new databases.
[2024-08-05 02.27.48] Importing Main DB.
[2024-08-05 02.28.27] Importing Blobs DB.
[2024-08-05 02.28.27] Successfully imported databases.
[2024-08-05 02.28.27] Verifying databases integrity after importing.
[2024-08-05 02.28.39] Verification complete.  PMS main database is OK.
[2024-08-05 02.28.39] Verification complete.  PMS blobs database is OK.
[2024-08-05 02.28.39] Saving current databases with '-BACKUP-2024-08-05_02.18.22'
[2024-08-05 02.28.39] Making repaired databases active
[2024-08-05 02.28.39] Repair complete. Please check your library settings and contents for completeness.
[2024-08-05 02.28.39] Recommend:  Scan Files and Refresh all metadata for each library section.
[2024-08-05 02.28.39] 
[2024-08-05 02.28.39] Backing up of databases
[2024-08-05 02.28.39] Backup current databases with '-BACKUP-2024-08-05_02.28.39' timestamp.
[2024-08-05 02.28.39] Reindexing main database
[2024-08-05 02.29.09] Reindexing main database successful.
[2024-08-05 02.29.09] Reindexing blobs database
[2024-08-05 02.29.09] Reindexing blobs database successful.
[2024-08-05 02.29.09] Reindex complete.
[2024-08-05 02.29.09] Automatic Check, Repair/optimize, & Index successful.
 
[2024-08-05 02.29.09] Starting PMS.

[chuck@glockner plexmediaserver.2006]$ 

I never have “SLOW QUERY”.
I never get “Held transaction too long”.
I do get the “Ignored” messages from the agents (ongoing development work). I ignore them.

I just ran the utility again using the same stop auto start exit function and let it run to completion.

After PMS started back up, I ran a library scan and saw the Slow query warnings again.

Per your earlier advice, “The most folks need to do is increase the inotify slot max in almost all cases”, I will work on this step over this coming week to see if it will help with my issues. Thanks again for your help

May I have your logs please ?

inotify is for use with “Automatically scan my library when new media detected”
It uses the inotify functionality of the kernel to work.

just downloaded the logs, may I send those to you in PM please?

Hi Khalid,

Sorry for the wait. I don’t check in that often. @ChuckPa is a great resource and I see he is engaged here, so always lean on his advice first.

As far as swap tuning goes, if you aren’t super comfortable with Linux then it might be best to leave well-enough alone. That said, if you want to tinker, it is a great easy-mode way to speed up your machine assuming you have plenty of RAM. To see your ram utilization, a great command-line tool is “htop”. If it looks like your system is never going above 80% util, then it is probably best to turn swappiness to zero. This means the system will only use disk in place of ram to prevent a crash. Otherwise, Linux is always wanting to swap out some portion of the RAM to disk…which is SLOW. Even at swappiness=1 it will do more than it should if you have plenty of ram.

I won’t provide advice on the basice of how to edit files, etc…that is a necessary part of the learning curve and if you can’t get that far comfortably, you’d best not be messing with system settings. :wink:

Linux is the best server OS by far, but it has a non-trivial learning curve. Good luck on your journey.

1 Like

OP’s server is not fancy, but I (and many of us) have run very similar hardware with the same OS in the past, with good success. The reports are weird because basically, this all should work without special tuning required. It’s also possible that the source of the slow queries log entry is not the same thing that’s causing playback problems. Looking forward to seeing the eventual solution here.

At this point I would boot into the BIOS and just start looking around at the settings too, maybe there are some weird settings. Maybe it’s a bad SATA cable. Maybe it’s a ghost. :person_shrugging: