Apple Mini (Late 2012) High Sierra CPU maxed out

Server Version#: 1.25.5.5492
Player Version#: 8.30.0.30944

Every night my plex server maxes out the CPU of the server and access to the playing files etc do not work. This started about a month ago and I found that the database had corruption so I followed directions and tried to repair it from backups many times. It keeps getting corrupt somehow
. I did find before it locks up the server it was getting stuck on a movie file “wreck it ralph” which I manually deleted from my HDD since I noticed that file in specific would mess things up. Yesterday it hung again and I repaired my database back to the backup I had from the 12th. This morning my server was maxed out again and stuck. I tried to see what was jamming it up but did not see anything that jumped out at me. I force closed the server then restarted now it is working fine again. This is driving me nuts, any help is appreciated.

There was an issue where some movie extras could have multiple (thousands) of database entries. This was fixed in 1.25.4.5487. Plex removes a portion of the entries during startup and nightly maintenance. In the worst cases it can take weeks to completely clean things out. The process can be forced by optimizing the database, but the system will be non-responsive until finished.

I think you ran into the cleanup process. Your server was running normally when you shut it down, removing metadata for a featurette (looks like one for Wreck It Ralph).

There are 2649 entries in Plex Media Server.1.log for destroying metadata for Featurette - Rich Moore, and they all have different item numbers. This is why I think you’re running into the problem mentioned above. The process started at 06:17 and was still in process when you shutdown Plex at 09:26.

This thread has additional details from identifying the problem to issuing a fix.

From Plex Media Server.1.log:

Feb 19, 2022 06:17:10.420 [0x70000356b000] DEBUG - Destroying metadata item 11521 (Featurette - Rich Moore)
....
Feb 19, 2022 09:26:09.331 [0x7000034e8000] DEBUG - Ordered to stop server.
Feb 19, 2022 09:26:09.331 [0x7000033e2000] DEBUG - Stopping server...
...
Feb 19, 2022 09:26:09.398 [0x70000356b000] DEBUG - Destroying metadata item 198934 (Featurette - Rich Moore)


Plex should eventually clean things up itself over time. You just have to let it run.

You can force the issue by manually optimizing the database.

The manual optimization will take a long time - tens of minutes or longer (as referenced in the other thread).

The system will be non-responsive while this happens, so plan accordingly (when you will not be streaming for awhile).

Go to SettingsServer_Name → Troubleshooting

Select Optimize Database.

2 Likes

@FordGuy61 Thank you so much. So I guess I was not patient enough. I just kicked off the optimization and I’ll leave it running for as long as it takes.

1 Like

I started an optimization yesterday when I replied and left it running and it is still going. My database is about 8.17GB. The CPU is maxed out still.
Screen Shot 2022-02-20 at 10.28.42 AM

Pull the log files. Let’s see if they show anything like before (destroying metadata, etc).

If it is the cleanup process hitting the CPU, stopping it won’t hurt anything. It just delays things. It will kick off again during the next maintenance cycle.

I had to force close the start up to get the logs. Here they are. Thank you for your help!!

Database optimization was still running, deleting an entry about every 4 seconds (~11k since 6 am today).

There’s some log entries I don’t understand (that’s a comment on my log reading skills, not the log entries themselves).

I’ll see if I can find some additional info tomorrow.

Ok, I just started the optimization again now and I’ll leave it running again.

@d1617 - I have been looking at the logs and there is evidence of lots of extras and also slow purging of orphaned entries in the database

Could you please shut down Plex Media Server and when the processes are terminated, then copy out these files

/Users/admin/Library/Application Support/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db
/Users/admin/Library/Application Support/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db-wal
/Users/admin/Library/Application Support/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db-shm

The last 2 may not exist after a tidy shut down of Plex Media Server

Please zip the files, upload to dropbox or google drive etc and send me by Private Message with cc to @FordGuy61 a link to where you uploaded the database files zip

The logs show a database optimize taking about 25-30 minutes to run - during this period, the server is effectively locked out and not available

Thanks

@sa2000

Ok, I just shut it down and I’m zipping up the files. Just an FYI it seems huge for whatever reason. I remember about 4 months ago or so the database was not this large (8GB). Together with all 3 files, it is up to 18GB. I’m going to upload it soon and message you both. Thank you!

I just sent you both a PM with the link. Thank you! I wish I knew how to read the files and decipher the issues.

Thank You - I have added the database to the issue I referred to the server development team

Do you know the sequence of the last few Plex Media Server updates applied

What version was applied and when ?

The issue was supposed to have got fixed in 1.25.4

I have established why the 1.25.4 fix was ineffective for the extras for one of your movies. It’s internal ID was not in the expected set of ID’s

This will need a new fix to be released

I am sorry, I do not remember the order of the updates. I believe I just updated shortly after the updates were released. I see Version 1.25.6.5577 available now you think I should update now or wait? I forgot I noticed it always seemed to get locked up on Wreck it Ralph for whatever reason so I have since removed that movie but it still thinks it is there and gets stuck.

Screen Shot 2022-02-22 at 10.09.20 AM

Well “Wreck It Ralph” movie is the movie that ended up with 4 million copies of the same Extra “Featurette - Rich Moore”

Please do update to 1.25.6.5577

I have sent you a PM asking for a new copy of the database after shutdown and carefully checking for processes in Activity Monitor and looking for the db-shm and db-wal files as well as the db

I have also given instructions to @FordGuy61 to help with manual adjustments to the database to remove the 4 million extras and related items in the various tables in the database - the fix did not remove these extras because the internal GUID was not as expected

1 Like

The reason the fix for the extras that came out in 1.25.4 has not resolved the issue was because the trailers/clips were not provided by Plex but through an add-on plugin:

Traileraddict

This is currently with the Plex Media Server development team to look into making the fix more general - meanwhile, the database is being manually amended to remove the extras

1 Like

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