# Load balancing Plex Media Servers - Master and Backup

**URL:** <https://forums.plex.tv/t/load-balancing-plex-media-servers-master-and-backup/896137>\
**Category:** Plex Media Server\
**Tags:** server-linux\
**Created:** [November 21, 2024, 3:12pm UTC](https://forums.plex.tv/t/load-balancing-plex-media-servers-master-and-backup/896137 "2024-11-21T15:12:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![MacGyver27](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/macgyver27/32/92928_2.png) [@MacGyver27](https://forums.plex.tv/u/MacGyver27)\
**Post date:** [November 21, 2024, 3:12pm UTC](https://forums.plex.tv/t/load-balancing-plex-media-servers-master-and-backup/896137/1 "2024-11-21T15:12:31Z")

</div>

Hello,

This is to find out to which “SYNC” level is possible load balance 2 Plex Media Servers (PMS)..

My scenario:

 ![image](https://global.discourse-cdn.com/plex/original/4X/2/7/b/27b5235b643b530c4ab63d2f5ea3c6959a91a2ac.jpeg)

#### Network layer:

- Site A is hosting primary PLEX Media Server
- Site B is hosting backup PLEX Media Server
- Site A is interconnected with Site B through private tunnel
  - Network speed of the tunnel is about 500mbps

- Site A is hosting on extra server Reverse Proxy engine which will loadbalance to Master PMS unless its down, then it will at network level switch over to Backup PMS

#### System layer:

- Both sites are running Debian 12
- Docker environment
- Backup PMS has 1:1 copy of all media files from Master PMS
  - Media files are synced daily from Master to Backup (never other way around)

- From the container perspective the file system is looking the same. All media appear in the very same folder structure.

#### Desired scenario:

- Master PMS is always serving if it is running
- Backup PMS is server only in case Master PMS is down
- Configuration changes like Users / Libraries / Server settings are done only on the Master PMS.
- Backup PMS is never configured via settings manually. It will be always loading config from the database which will be taken from the Master PMS.
- Data related to user content state like watch position, watch history, ratings, watchlist etc
  - ideally in sync between Master PMS and Backup PMS (every hour or so) - so in case Backup PMS is serving it will push its history data over to Master PMS and vice versa.
  - not ideally but “ok” if Backup PMS will use Master PMS data and don’t update Master PMS about changes in case Backup PMS is serving.

#### Findings:

Plex Media Server is storing all its configuration in multiple database files:

- com.plexapp.plugins.library:
  - `com.plexapp.plugins.library.db`
  - `com.plexapp.plugins.library.db-shm`
  - `com.plexapp.plugins.library.db-wal`
  - `com.plexapp.plugins.library.db.fix`

- com.plexapp.plugins.library.blobs:
  - `com.plexapp.plugins.library.blobs.db`
  - `com.plexapp.plugins.library.blobs.db-shm`
  - `com.plexapp.plugins.library.blobs.db-wal`

- com.plexapp.dlna:
  - `com.plexapp.dlna.db`
  - `com.plexapp.dlna.db-shm`
  - `com.plexapp.dlna.db-wal`

My plan to achieve the desired scenario is to `rsync` correct database/s between Master PMS and Backup PMS. However I need to understand to which level this can be achieved and if there exists a better approach than using scheduled `rsync`.

Thank you!

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/plex/original/3X/2/a/2acb9765406f63293d357b4ec509ec39aa28f2ad.png) [@system](https://forums.plex.tv/u/system)\
**Post date:** [February 19, 2025, 3:12pm UTC](https://forums.plex.tv/t/load-balancing-plex-media-servers-master-and-backup/896137/2 "2025-02-19T15:12:45Z")

</div>

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