Plexmediaserver spins up all ext. drives at start

Hi,

I’m currently using Plex Media Server 1.16.6.1592-b9d49bdb7 on an Arm64 device which is running smoothly. However, one thing that I would love the devs to look into is why it is necessary to spin up all hard drives every time the service plexmediaserver is starting. This can i.e. be after upgrading to a newer version.

I can’t figure out why it should be necessary to spin up all external drives when there isn’t a scan for new library content, anyone accessing a file or so on… Hopefully this will be looked into :slight_smile:

Thanks in advance!

I would suspect it’s checking that the drives are available.

It most definitely is, but PMS still has to do that the next time a user actually want to access content or scan for new library content, so there is no reason to check in the first place when there isn’t anyone accessing content or updating the library.

When PMS starts:

  1. It verified ALL the referenced directories used in your Library definitions are accessible.
  2. If you have enabled automatic detection of new media, PMS will also read and create a list of all the directories to monitor. This list is then added to the Kernel’s iNotify list.

This is how Linux works. It doesn’t know what’s there unless it reads it. If it’s not spinning, then it spins up (can’t read a drive which isn’t)

I’ve not enabled automatic detection of new media, so case 2) can be excluded.

Regarding case 1), I still don’t get why PMS has to verify that referenced directories are accessible when there is no need to access them at the specific moment… Shouldn’t it be enough to just check the directory a user want to access when needed? I mean, it doesn’t change the fact that if PMS verify that all Library references are intact at time 0, a later state at time 1 is independent of what happened at time 0 as it still needs to check the directory a user want to access. So verifying in the beginning doesn’t guarantee that if PMS has confirmed that all directories are intact at time 0, they will still be intact at a later time.

I hope this is something you devs might consider as it is a tweak request where case 1) is not needed unless case 2 is activated. And I don’t see why it shouldn’t be changed as it does nothing except spinning up hard drives, which increase tearing and power consumption. I guess this relevant for other OS than just Linux

Plex cant change Linux. Linus and team would never allow it.

The functionality you’re challenging is the opendir() library call. It is what it is, always has been, and will always be.

Sorry

Okey. I thought it was in the PMS codebase it verified that all library directories are accessible when starting the service, which could simply be changed to not check unless case 2 is enabled. If this is the case, then starting PMS service regardless if any libraries are added, all external drives will spin up?

Even if not enabled to automatically update, PMS must know if the existing media is available.

Have you ever seen the Red trash can over a media poster? This is Plex telling you that fundamental access is gone. The only way it can do this is by opening the top-most directory in the Library path.

If that top-most directory is inaccessible, this tells PMS of a hardware / access issue and to not remove all the media stored there.

If it did not perform this test, it would remove everything. Think of how USB drives operate. Would you want PMS to delete all the media you store on a USB drive just because you forgot to turn it on ?

@alehandro.ax The “increased” power consumption is neglectable and also the “increased tearing”. Don’t get me wrong, but there is just really no need to change the current behavior.

This is what I don’t understand. Why must PMS know if existing media is available when the user don’t want to access it at that time or do any changes to the library? It still has to know if existing media is available when a user actually wants to access media or do any changes to the library at a later state, right?

And I agree that the power consumption saving is quite low, but one has to see the bigger picture where example 100 000 hard drives are not spun up every time PMS start.

Regardless, I only wanted to hear the reasoning for this and hopefully show that it could be changed in the future as it doesn’t change the fact that it still has to verify when a user want to access media or modify the library at a later time :+1:

Why must the OS spin up your drives and know they are even there when it boots?

It doesn’t know, nor does PMS know. You programmed the mount table.

Please, if spinning a drive at $0.10/KWH (about 3.5 days) is too costly , perhaps a media server isn’t right for you? Perhaps a cloud-based solution or SSD is more appropriate (at 3.6 watts typical) ?

This discussion will serve no further purpose. Nothing will change.

My OS creates mount points, so it’s a totally different scenario as it has to access external drives. PMS however, it only verifies that the library references are accessible, which serve no purpose as it still has to do that every time later when a user want to access media or modify the library… This is my point. Verifying at the beginning shouldn’t be necessary as it doesn’t impact further usage…

The cost perspective isn’t a deal for me, it’s more the noise from the drives. However, such a small improvement which affect so many hard drives will eventually play a bigger role when you see the bigger picture with the whole user base of Plex which have external drives.

This might not be changed in the close future, but let’s hope it eventually does… :slight_smile: