# Slow library performance due to increasingly growing database

**URL:** <https://forums.plex.tv/t/slow-library-performance-due-to-increasingly-growing-database/740511>\
**Category:** Plex Media Server\
**Tags:** server-linux\
**Created:** [September 1, 2021, 8:22pm UTC](https://forums.plex.tv/t/slow-library-performance-due-to-increasingly-growing-database/740511 "2021-09-01T20:22:24Z")\
**Posts on this page:** 1\
**Showing post:** 40

<div class="post-metadata">

**Author:** ![spartan018](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/spartan018/32/262813_2.png) [@spartan018](https://forums.plex.tv/u/spartan018)\
**Post date:** [December 6, 2021, 9:51pm UTC](https://forums.plex.tv/t/slow-library-performance-due-to-increasingly-growing-database/740511/40 "2021-12-06T21:51:05Z")

</div>

@sa2000, I’ve PMed you the debug logs. A few more things I thought of that could be of note:

- I’ve been running my Plex server for the better part of a decade, so I’m sure the database has gone through more than a few migrations. I had previously thought the database file may have become corrupt and manually repaired it as described [here](https://support.plex.tv/articles/repair-a-corrupted-database/), though that obviously did nothing to help.
- I don’t recall exactly when, but at some point this summer I finally upgraded my movie library to use the new Plex agent as described [here](https://support.plex.tv/articles/upgrading-a-movie-library-to-the-use-the-new-plex-movie-agent/), and it’s very possible that I did this shortly before the number of extras started to grow seemingly exponentially.
- The affected movie was actually two video files (Logan, and Logan: Noir Edition) that were previously separate but must have been combined when upgrading to the new agent without me realizing.
- Simply clicking on the three-dots icon for the movie and clicking “Refresh Metadata” did NOT trigger the creation of new extras, but after reverting the database and trying again I found that first clicking “Get Info” immediately triggered a metadata refresh which DID trigger the creation of new extras. No idea what that’s about, but I’m sure you will.
- Just for the sake of being thorough, CPU usage during the refresh process was between 100-200%, and memory usage more than quadrupled to \>6GB at its peak. As you’ll see from the logs, it took about 10-15 mins of doing some kind of background work before it started to actually add the new extras. Once that started, the tab for the web UI I had open actually froze with ~150% CPU usage (I’m guessing a crazy amount of data was coming in over the websocket?)

Hope this helps.

PS: as a mostly-unrelated and minor bug report: if the `PMS Plugin Logs` folder is missing from the `Logs` folder, Plex won’t start. That could probably be handled more gracefully by just creating any missing folders.

---

_[View the full topic](https://forums.plex.tv/t/slow-library-performance-due-to-increasingly-growing-database/740511)._
