Scaling Plex Media Server (multiple instances, one db and datastore)

Hi there

I’m looking into scaling Plex Media Server within Docker. My aim is to have multiple instances of Plex Media Server running with a shared database (as PMS uses SQLite as a database, concurrent writes will not be possible and will lock the whole db, but I am okay with that).

I am interested to hear if anyone else has any experience with this, and if so what issues they came across? I shall post my own experiences here.

For reference, I aim to eventually put PMS on a Kubernetes cluster in order to automatically scale for demand by load-balancing across each instance.

I love this idea and hope in your success, I only have a single node kubernetes setup but really hope to hear about your status soon.

So how are you going to separate the reads and the writes? I think internal changes would need to occur to have this work. Also instead of trying to scale this way why not transcode and just use cloud storage option that plex pass gives you? Seems like that would provide scalability above anything you’d get in a cluster.

I hope you are not running plex as a replication controller. I’m thinking you’d want to deploy this as manifests as you’d want some affinity rules in place so that you don’t end up with multiple plex containers all trying to share the same cpu on one node.

What is actually possible is to distribute transcoding tasks by a third party plugin, just make a search in this forum :slight_smile:

@munnerz @Jig_Saw

I like this idea as well, and as it stands the only load balance option that has working support is the Linux build. a windows server 2012r2 build was done as well, but there is less a working model for that then active support.

I run windows, and would like more development with the windows platform.

Is there anyway to have an sqlite to mysql/mariadb connector? So that way you could just feed all the queries to a larger sql cluster?

I was thinking it would be an amazing “advanced” feature to configure SQL. I have a SQL server that would be perfect to house the databases for Plex in my infrastructure. It’s just a shame Plex, like so many media web apps, use SQLite :frowning:

This has nothing to do with the scaling of the db, but I am placing the link here that I just posted about how I eventually plan to scale out my storage (increasing/addition not replacing) as it “may” fit well with your solution for a truly scalable PMS infrastructure.

any update on this project?

1 Like

We can test this. It’s probably not feature complete but Hopefully someone with a bit more expertise can help. https://github.com/wnielson/Plex-Remote-Database