# Plex com.plexapp.plugins.library.db over 2GB

**URL:** <https://forums.plex.tv/t/plex-com-plexapp-plugins-library-db-over-2gb/600984>\
**Category:** Metadata & Adding Files\
**Tags:** server-windows, server-linux\
**Created:** [June 7, 2020, 6:41pm UTC](https://forums.plex.tv/t/plex-com-plexapp-plugins-library-db-over-2gb/600984 "2020-06-07T18:41:00Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![wiser212](https://avatars.discourse-cdn.com/v4/letter/w/8e7dd6/32.png) [@wiser212](https://forums.plex.tv/u/wiser212)\
**Post date:** [June 7, 2020, 6:41pm UTC](https://forums.plex.tv/t/plex-com-plexapp-plugins-library-db-over-2gb/600984/1 "2020-06-07T18:41:01Z")

</div>

Server Version#: 1.19.4.2902  
Player Version#: 4.30.2  
Enable Intro detecttion: off  
Enable video preview thumbnails: off  
Save progress of songs: off  
Tag photos: off  
Number of libraries: 34  
Running Windows 10 on NVMe drive  
PMS on the same NVMe drive  
i7 CPU with 16GB of RAM on dedicated machine (not VM)

My Plex com.plexapp.plugins.library.db is over 2GB. I have over a million files (music, movies, TV, photos, videos) and I’m only have 30% my total in Plex. It is taking over 15 seconds to load each library. Did I hit the limitation in Plex or is what I’m doing wrong? I don’t think I can import the remaining 70% of my collection. Any way to move the Plex DB to MariaDB, MSSQL or any other database with better performance?

---

<div class="post-metadata">

**Author:** ![ChuckPa](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/chuckpa/32/79710_2.png) [@ChuckPa](https://forums.plex.tv/u/ChuckPa)\
**Post date:** [June 7, 2020, 7:08pm UTC](https://forums.plex.tv/t/plex-com-plexapp-plugins-library-db-over-2gb/600984/2 "2020-06-07T19:08:11Z")

</div>

Do you have the following ?

1. Settings - Server - Library - Empty trash after every Library scan
2. Settings - Scheduled Tasks - Optimize database every week

---

<div class="post-metadata">

**Author:** ![wiser212](https://avatars.discourse-cdn.com/v4/letter/w/8e7dd6/32.png) [@wiser212](https://forums.plex.tv/u/wiser212)\
**Post date:** [June 7, 2020, 7:09pm UTC](https://forums.plex.tv/t/plex-com-plexapp-plugins-library-db-over-2gb/600984/3 "2020-06-07T19:09:29Z")

</div>

Database is optimized after each scan. I also clean bundles and empty trash after each scan of each library. I do this manually. I also turned off automatic scan because the library is so big and the performance is so bad that no client can connect to the server when scanning/optimizing/cleaning bundles. I also have scan priority set to low.

---

<div class="post-metadata">

**Author:** ![ChuckPa](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/chuckpa/32/79710_2.png) [@ChuckPa](https://forums.plex.tv/u/ChuckPa)\
**Post date:** [June 7, 2020, 7:11pm UTC](https://forums.plex.tv/t/plex-com-plexapp-plugins-library-db-over-2gb/600984/4 "2020-06-07T19:11:53Z")

</div>

Music carries a lot of data with each track which does add to the size as do photos.

Do you have a SSD to use as cache / move PMS to?

Is this on Windows or Linux? You’ve marked both.

---

<div class="post-metadata">

**Author:** ![wiser212](https://avatars.discourse-cdn.com/v4/letter/w/8e7dd6/32.png) [@wiser212](https://forums.plex.tv/u/wiser212)\
**Post date:** [June 7, 2020, 7:14pm UTC](https://forums.plex.tv/t/plex-com-plexapp-plugins-library-db-over-2gb/600984/5 "2020-06-07T19:14:49Z")

</div>

Thanks for the reply 🙂  
It is running on Windows. I will considering moving to Linux if performance is better there. Windows runs on NVMe which is where PMS also sits. 180+GB free space left on the NVMe drive.

---

<div class="post-metadata">

**Author:** ![ChuckPa](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/chuckpa/32/79710_2.png) [@ChuckPa](https://forums.plex.tv/u/ChuckPa)\
**Post date:** [June 7, 2020, 7:19pm UTC](https://forums.plex.tv/t/plex-com-plexapp-plugins-library-db-over-2gb/600984/6 "2020-06-07T19:19:55Z")

</div>

If you’re already on NVMe, and the CPU is hefty enough, then Windows I/O is likely holding you back.

Linux isn’t for the timid so be advised.  
We are here to help with Linux but we aren’t equipped to teach Linux so be prepared to master Linux basics using Google & a play VM as your first step.

I suspect your CPU or Windows, or the pair, is the holdup.

I can take SQLite3, on Linux, and pull 15 million record queries in 1-2 seconds with an i7.  
Switching to another DB engine doesn’t help when reading.

---

<div class="post-metadata">

**Author:** ![wiser212](https://avatars.discourse-cdn.com/v4/letter/w/8e7dd6/32.png) [@wiser212](https://forums.plex.tv/u/wiser212)\
**Post date:** [June 7, 2020, 7:25pm UTC](https://forums.plex.tv/t/plex-com-plexapp-plugins-library-db-over-2gb/600984/7 "2020-06-07T19:25:05Z")

</div>

Very interesting on the Linux performance. I have plenty of Linux boxes here so there’s no challenge in setting it up. Just want to see if there is significant gain in moving to Linux (Ubuntu to be specific). Windows is currently on an i7 with 16GB of RAM dedicated machine. On the DB side, I’m assuming table indexing is done properly? Can we peak at the table structure through a client?  
If I switch to Linux, it will be in a VM on an ESXi server that has dual Xeon’s and 96GB of RAM. Any recommended resource allocation in terms of CPUs and memory?

Or the better question, does the size of the DB look out of place or is that still within what Plex can handle?

---

<div class="post-metadata">

**Author:** ![ChuckPa](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/chuckpa/32/79710_2.png) [@ChuckPa](https://forums.plex.tv/u/ChuckPa)\
**Post date:** [June 7, 2020, 7:35pm UTC](https://forums.plex.tv/t/plex-com-plexapp-plugins-library-db-over-2gb/600984/8 "2020-06-07T19:35:07Z")

</div>

Will there be hardware transcoding?

Given how much media you have indexed, I’m surprised the DB is that small.

---

<div class="post-metadata">

**Author:** ![wiser212](https://avatars.discourse-cdn.com/v4/letter/w/8e7dd6/32.png) [@wiser212](https://forums.plex.tv/u/wiser212)\
**Post date:** [June 7, 2020, 7:50pm UTC](https://forums.plex.tv/t/plex-com-plexapp-plugins-library-db-over-2gb/600984/9 "2020-06-07T19:50:07Z")

</div>

Very minimal transcoding. Everyone will be direct play, (hopefully). What is considered a large DB file?

---

<div class="post-metadata">

**Author:** ![ChuckPa](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/chuckpa/32/79710_2.png) [@ChuckPa](https://forums.plex.tv/u/ChuckPa)\
**Post date:** [June 7, 2020, 8:05pm UTC](https://forums.plex.tv/t/plex-com-plexapp-plugins-library-db-over-2gb/600984/10 "2020-06-07T20:05:13Z")

</div>

I’ve seen then go as high as 4GB

I have 150K entries, for all my test sets, and my DB is 393 MB  
Take into consideration, there are no photos and only 38K music tracks.

For the VM, with DirectPlay, giving Linux enough room to cache the DB in RAM (normal file buffer), I would allocate 8GB. Utilization of RAM would be:

1. 1-1.5 GB for the kernel.
2. 1 GB for the distro’s support processes.
3. Up to 1GB for PMS to perform basics (but can temporarily grow when indexing more media as well as transcoding)

All said and done, 4GB is fairly minimal. 8GB , which is what we recommend for NAS platforms, works very well.

---

<div class="post-metadata">

**Author:** ![wiser212](https://avatars.discourse-cdn.com/v4/letter/w/8e7dd6/32.png) [@wiser212](https://forums.plex.tv/u/wiser212)\
**Post date:** [June 7, 2020, 8:22pm UTC](https://forums.plex.tv/t/plex-com-plexapp-plugins-library-db-over-2gb/600984/11 "2020-06-07T20:22:36Z")

</div>

Thanks! Anything special I need to do to cache the DB into RAM?

---

<div class="post-metadata">

**Author:** ![ChuckPa](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/chuckpa/32/79710_2.png) [@ChuckPa](https://forums.plex.tv/u/ChuckPa)\
**Post date:** [June 7, 2020, 8:28pm UTC](https://forums.plex.tv/t/plex-com-plexapp-plugins-library-db-over-2gb/600984/12 "2020-06-07T20:28:47Z")

</div>

No. Linux will do that automatically for you.

`free -m` (to examine free memory) will show you how much is being used and what the buffer usages are:

e.g. Reported in Megabytes.

```auto
[chuck@lizum /vie.508]$ free -m
              total used free shared buff/cache available
Mem: 32035 4838 20126 302 7070 26428
Swap: 62499 0 62499
[chuck@lizum /vie.509]$ 

```

---

<div class="post-metadata">

**Author:** ![wiser212](https://avatars.discourse-cdn.com/v4/letter/w/8e7dd6/32.png) [@wiser212](https://forums.plex.tv/u/wiser212)\
**Post date:** [June 9, 2020, 1:35am UTC](https://forums.plex.tv/t/plex-com-plexapp-plugins-library-db-over-2gb/600984/13 "2020-06-09T01:35:00Z")

</div>

Hey,  
So I decided to move from Windows to Linux. Followed a guide here on what to copy over and what to set up. I installed Plex on Ubuntu, mapped all my shares so Plex can see them (no permission issues). I copied over Metadata, Media, Plug-ins Support, Plug-ins. I am able to start Plex, I can see all the migrated libraries. I picked a small library and added the correct linux path to the library without deleting the old Windows UNC paths. I am able to save and all. However, when I go to scan, it just goes from Scanning to Scanning complete real quick without actually doing the scan. It is not detecting the path that I added and scanning it. Am I missing a step somewhere?

Thanks

---

<div class="post-metadata">

**Author:** ![ChuckPa](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/chuckpa/32/79710_2.png) [@ChuckPa](https://forums.plex.tv/u/ChuckPa)\
**Post date:** [June 9, 2020, 1:49am UTC](https://forums.plex.tv/t/plex-com-plexapp-plugins-library-db-over-2gb/600984/14 "2020-06-09T01:49:16Z")

</div>

If it finishes that quickly, there is a problem.

Logs please?

---

<div class="post-metadata">

**Author:** ![wiser212](https://avatars.discourse-cdn.com/v4/letter/w/8e7dd6/32.png) [@wiser212](https://forums.plex.tv/u/wiser212)\
**Post date:** [June 9, 2020, 2:48am UTC](https://forums.plex.tv/t/plex-com-plexapp-plugins-library-db-over-2gb/600984/15 "2020-06-09T02:48:50Z")

</div>

Should have looked at the log. It was due to a scanner that doesn’t exist. Changed to the standard scanner and all is scanning again. Now will see if it actually keeps my custom data that I entered along with the artwork for titles that were missing them from the default scan.

Update: So it is scanning. However, it is not retaining my artwork. I have to manually go into each one and change the artwork. I don’t have to re-download the artwork, I just have to select it. Is this normal behavior in this situation?

---

<div class="post-metadata">

**Author:** ![ChuckPa](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/chuckpa/32/79710_2.png) [@ChuckPa](https://forums.plex.tv/u/ChuckPa)\
**Post date:** [June 9, 2020, 3:18am UTC](https://forums.plex.tv/t/plex-com-plexapp-plugins-library-db-over-2gb/600984/16 "2020-06-09T03:18:01Z")

</div>

Yes. Everything you had is still there unless you purged the cache’s manually or cleaned bundles.

---

<div class="post-metadata">

**Author:** ![wiser212](https://avatars.discourse-cdn.com/v4/letter/w/8e7dd6/32.png) [@wiser212](https://forums.plex.tv/u/wiser212)\
**Post date:** [June 10, 2020, 11:03pm UTC](https://forums.plex.tv/t/plex-com-plexapp-plugins-library-db-over-2gb/600984/17 "2020-06-10T23:03:48Z")

</div>

Reporting back. Went through the migration fairly painless after sorting out the custom scanner issue that I had. Everything is working, didn’t lose my ark work for most. Did lose some for others but only a small percentage. And they were lost because of naming convention of episodes that Plex did not pick up, so there is nothing wrong with the migration process, but more of bad naming convention. Thought this might be useful in case someone is or will be doing the migration.

---

<div class="post-metadata">

**Author:** ![TeknoJunky](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/teknojunky/32/165055_2.png) [@TeknoJunky](https://forums.plex.tv/u/TeknoJunky)\
**Post date:** [June 11, 2020, 12:35am UTC](https://forums.plex.tv/t/plex-com-plexapp-plugins-library-db-over-2gb/600984/18 "2020-06-11T00:35:39Z")

</div>

did switching to linux actually solve your problem and/or improve performance?

my db is ~1.4gig and my entire plex data volume is `/dev/sdz btrfs 932G 680G 252G 74% /dataplex`

I keep all my plex data on a dedicated 1tb ssd (not nvme), nothing other than the plex support hierarchy.

Obviously the bulk of the metadata is chapter/video preview thumbs.

But in any case, as your db scales larger, you need extremely low latency storage, and as much single thread cpu power as you can get. (while sqlite does have some multi-threading, sooner or later everything comes down to IOPS, both storage and cpu).

another thing to consider, when scaling out, is splitting into multiple servers, ie a music server, tv server, movie server.

this would allow you to manage resources from each independently according to load/need, and since each would be independent, load/rescans/etc against one server/db, would not affect the other server(s).

and with the plex uno client interface, having multiple servers is ‘no big deal’ since you can simply pin the libraries you want even if they are different servers or even locations.

---

<div class="post-metadata">

**Author:** ![wiser212](https://avatars.discourse-cdn.com/v4/letter/w/8e7dd6/32.png) [@wiser212](https://forums.plex.tv/u/wiser212)\
**Post date:** [June 11, 2020, 2:09am UTC](https://forums.plex.tv/t/plex-com-plexapp-plugins-library-db-over-2gb/600984/19 "2020-06-11T02:09:17Z")

</div>

I am not sure if my performance problem is fixed or not. What I did was partially rebuild Plex as a new instance on a different server to see where the bulk of the media/metadata folders are coming from. I did all my videos files, then migrated to Ubuntu (headless). Media/Metadata was around 60gigs without video preview or intro detection, with database file at 360+ megs. With that size, there is no performance issue. I copied that instance over to Ubuntu and started to index music. It is now at 90gigs for media/metadata with the db file at 760+ megs. I have scanned about 250,000 tracks so far, excluding all video/photo files. The apple to apple comparison will be when I hit 2gb on the DB file, then I can see how it performs as well as how big media/metadata directories are. I’ll keep reporting back with progress.

---

<div class="post-metadata">

**Author:** ![TeknoJunky](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/teknojunky/32/165055_2.png) [@TeknoJunky](https://forums.plex.tv/u/TeknoJunky)\
**Post date:** [June 11, 2020, 2:40am UTC](https://forums.plex.tv/t/plex-com-plexapp-plugins-library-db-over-2gb/600984/20 "2020-06-11T02:40:00Z")

</div>

this thread may be useful in your search for performance improvements

> [@Docker container keeps loosing connection/access - DB constantly busy](https://forums.plex.tv/t/docker-container-keeps-loosing-connection-access-db-constantly-busy/590693):
>
> Server Version#: 1.19.3.2764-ef515a800 Player Version#: 8.1.0.17650 nVidia shield Docker Image#: plexinc/pms-docker latest a0ffee54489d 10 days ago 484M Host: Ubuntu 20.04 LTS 4 Core CPU, 6GB RAM [docker\_inspect\_plex.txt](https://forums.plex.tv/uploads/short-url/ciIQXuajk6sGjHti192pNaHLs4X.txt) (14.8 KB) [Plex\_crash\_or\_offline.zip](https://forums.plex.tv/uploads/short-url/MOlhZYehX31wPp6XVn7F0N8vzK.zip) (8.1 MB) I recently migrated my plex server over to docker, putting the config/Application Data folder on a hard drive mount that would solely be used for Plex. Since migrating to docker, I have noticed …

[Next page](https://forums.plex.tv/t/plex-com-plexapp-plugins-library-db-over-2gb/600984.md?page=2)
