Is it safe to move just the Library/Application Support/Plex Media Server/Metadata directory to another server and mount it via NFSv4 or iSCSI, while keeping the rest of the data (cache, database, etc) on the original drive? For NFS, do I need to change any settings around locking? I’m using Docker so I’d just make Library/Application Support/Plex Media Server/Metadata a separate bind mount.
I only use my Plex server for music that I’ve ripped from CDs over the years. The Plex server is on a VPS with fast NVMe drives, but I don’t have much storage on it. The actual media is stored on a different VPS with regular hard drives (which is much slower but has much more storage), mounted via NFS. This is working fine, but I’m running out of space on the NVMe VPS so I need to move more things to the HDD VPS.
NFS is not safe. There is insufficient file locking guaranteed on the NFS server side.
iSCSI has not been tested. It is a block device instead of a file device (NFS). It makes sense the block i/o drivers of the OS will treat it better but again – not tested.
The biggest challenge will be iSCSI latency between target and lun.
Even if there’s only one client and I use NFS v4? In theory NFSv4 should support both full-file locking as well as byte-range locking.
Yeah, it’s a block device. A lot of hosting services that let you add block storage use iSCSI under the hood. It just looks like a regular hard drive to the operating system, and you can partition it like you would any other drive.
There’s also NBD (Network Block Device) which is a protocol that allows reading and writing ranges of bytes over the network, exposing it as a block device on the client side. It’s faster than iSCSI since it doesn’t have to use SCSI commands, but it’s potentially less reliable.
I suspect they’ll work fine since the OS just sees it as a regular drive, so maybe I’ll test it.
The other option I’ve got is to move the Plex server to a different server I’ve got with more SSD disk space. This would let me keep the metadata locally, however there’d be more latency when accessing the actual media files since that’d have to go over the internet rather than a LAN. I hear some people use cloud storage via rclone for their media libraries so I suspect using a different server would be fine too.
The emphasis on should support does not extend to how PMS locks the DB.
What results, which I’ve tested on NFS extensively, is a corrupt database.
PMS was not designed to be run in a distributed manner.
iSCSI should work fine because it is, as we know, a block device and handled differently than the network file sharing layer. I’ve not taken the time to prove that this works reliably because it’s rarely used. The performance hit is pretty bad when PMS is accessing the DB over any network … even a 10GbE link.
With iSCSI, all locking is handled within the local kernel block i/o driver.
The network simply connects to the remote storage.
With NFS, the remote NFS server is setting the advisory locks and that’s the key – the locks are not absolute.
Here are my results and instructions should you wish to pursue it using NFS