[REQUEST] Move from SQLite to MySQL or Postgres

Again, how? Do you have any script etc. that can stress the DB specifically and let us give you performance numbers from before and after the change?

The current allowance of increasing the cache_size is very small which hasn’t resulted in any significant difference with real world loads (which may be placebo too) other than the general stability.

The only thing I can say for sure is that the stability has increased measurably with both the cache_size & page_size increased to 9999 & 4096 respectively. The database used to earlier crash or get deadlocked about 2-3 times daily which has now reduced to around once every day or two at the most. I am not sure how to give you measurable metrics aside from this observation.

3 Likes

How can I change these values ? :slight_smile:

I installed Emby and it’s 100% stable… But would prefer to continue to use Plex tho…

Today I noticed that all those
“Sqlite3: Sleeping for 200ms to retry busy DB” messages appear after PMS update… So is it some special activity that is going on with the database after each update? If so, how can i disable it?

1 Like

I have a rahter big database (around 1GB), I have SLOW QUERY all the time. Plex seems to be stable but I can’t fix the SLOW QUERY, maybe postgres or mysql will.

That “slow query” log is arbitrary. A few hundred ms might not be a big deal.

Is your database on SSD? If not, that would make a big difference.

Happy New Year!

Yes, I think it’s a Samsung 970 Evo Plus from 2 TB

1GB is pretty big.

Please see this thread; there may be extra records in your DB, and Plex is working on a fix. If this is the case, it’s got nothing to do with the specific DB engine.

1 Like

Hope this issue is fixed soon :confused:

1 Like

Disabling “Extras” and refreshing metadata fixed the issue ( for now ) for me. Just a hotfix, not a real fix in the long run.

If Plex is using a DB abstraction layer, it shouldn’t be.

Locking a platform into a single database by using database specific features is a bad design choice.

This is a gross oversimplification and exaggeration and coming from a CTO/Co-Founder is an inappropriate dismissive response. One external relational database system that’s designed for larger datasets would be sufficient. Although if Plex used an abstraction layer, the underlying DBMS would be irrelevant.

Additionally, since this would be for advanced users there’s absolutely zero reason to assume Plex needs to bundle it. In fact it would be better if Plex didn’t bundle it. The whole point of this request is to allow for an external DBMS to be used.

I have a moderate sized library and my logs are filled with slow queries, I’m running on a 2 drive NVMe RAID 0 using Samsung 980 Pro on Linux with Intel(R) Xeon(R) CPU E5-2680 v4 @ 2.40GHz and 64GB of RAM. I haven’t limited the CPU or RAM usage to the Plex docker container either.

So either a) Plex isn’t using indexes correctly, in which case you need a DBA to optimize how Plex is using SQLite, or b) Plex is hitting reasonable limitations in the SQLite database. Either one requires investigation and resources.

Even SQLite suggests using a real RDBMS for Client/Server applications which Plex very much is. Appropriate Uses For SQLite

So why even bother logging it?

The message I’m getting here is Plex does not want to dedicate resources to this and is telling everyone to get bent. Including those who paid for the product. So why not just close the topic and come out and say “We’re never going to fix this.”

10 Likes

You know, with @elan comments, and @gbooker02’s dismissive response, makes you wonder why more and more people are moving away from Plex. You can make all the arguments you want, and because it’s something they don’t see a value in, or a way to profit from, it’s not going to be done. It seems Plex thinks none of us are engineers, developers, programmers, etc and that we don’t understand what we’re talking about.

I never said “Support all the databases”. While I did say ‘supporting multiple databases’, this could be as easy as continuing to support SQLite and adding support for mySQL or Postgres.

@gbooker02 's response to me regarding this was:

Which again goes to show that Plex thinks we’re all dumb users with no knowledge. And as someone who has written software that supports multiple databases, and as others have done, we use an abstract layer, and try to stay away from things that are specific to one DB, but understand this isn’t always avoidable, and you plan for that.

It boils down to this; they’ve invested a good amount of time in developing PMS for use with SQLite. They have no intention on moving to a different DB. As Elan stated:

Which either he doesn’t monitor the forums/reddit/etc or is just refuses to accept that this is just not true. If this was the case, there would not be numerous posting on how to repair plex database corruption, etc. Further, unless I missed something in the privacy policy, Plex doesn’t know what media we have, or how much media an individual user has, so to make that statement is baseless and without data to back it up, unless Plex is collecting more media information than they let on And even the information that is sent to collect metadata information, the policy states:

  1. Usage Statistics for Personal Content . We may collect usage statistics for Personal Content. This includes information about your interaction with the Services, such as device information, duration, bit rate, media formats, resolution, and media type (music, photos, videos, etc.). Where possible, we will generalize this information to avoid identifying your Personal Content. Usage statistics do not include specific content titles or filenames. We may use information related to your usage to run and improve our Services, to provide, customize, and personalize communications and other content that we deliver or offer to you.

This is a reason I’m excited about the Olaris project. Out the gate they support MySQL and Postgres. While it’s not there yet in terms of everything Plex offers, it’s getting there and their developers are more than happy to take input, and implement things the community wants. Case in point, their invite system – I asked for a way once you invite someone to generate the full URL with the invite code, instead of just the invite code. Something simple, and instead of having to wait until the, was implemented. The project is open source, and they welcome PRs. I’m running it side-by-side and even displaying the content in libraries is blazingly faster than Plex rendering. I’m testing both their SQLite and MySQL backends and I’ve been impressed. As soon as they have a few more native clients, I think we will be leaving Plex behind all together.

It really feels like Plex has become somewhat complacent and feel like they are the Microsoft, Apple, etc of streaming and that users will just take what they give them and deal with it. Understand that there are more competition out there, and one day you can be knocked off your throne.

10 Likes

I’m closing this thread because it’s not productive.

2 Likes