Cache/PhotoTranscoder Folder Size Sanity Check

It seems that some people have a problem with their photo transcoder cache. My server has been crashing because the root drive is filling up with over 100GB of space being taken up in the PhotoTranscoder Cache directory. Please put in some mechanism to either run cleanup more often. Or some sanity check on this directory however plex sees fit to manage the size of this directory better. Thank you!

The size of that folder is proportional to the size of your media collection and the number of different clients accessing your server. So, do you have a lot of content and do you share your server with lots of people?

There is also a scheduled task to remove unused information. Have you enabled this?

Remove old cache files every week

This is not a great suggestion for people with large libraries and small OS partitions/drives. My PhotoTranscoder cache on my Mac Plex Server is 40gb, on a 128gb SSD. It is set to clean up weekly, but never gets below 35gb. I’m trying to upgrade to BigSur right now, and the only way i can do that is to completely delete this folder. Having the ability to set custom locations for cache files like this, would be a simple fix for all of this. I have nearly 12tb of free space on my RAID drive, and it kills me that THIS cannot be moved there.

You can create a symlink yourself.

Customisable max dirsize would be a nice option.

Also:

Remove old cache files every week

Does not remove everything older than 1 week, as the name (kind of) implies.

That’s what what it was meant to imply. It removes old caches on a weekly basis, but it removes ones that are 30 days old. So it’s a rolling 30-day, done once a week. Sorry for the confusion.

1 Like

Thanks for the replies. This is a directory that is taking literally hundreds of gigabytes. I have maybe 4 people who access the server maybe a handful of times a month with 8TB total media.

Like, what in the HECK is this directory doing. Is there something I can turn off to stop whatever it is that caching here?

I think all that people are asking for is some kind of sanity check around what is taking up literally hundreds of GBs. Max directory size, maybe a free space check, or just something that is in advanced where you can make the cleanup schedule a little more aggressive.

My server crashes all the time because of this, its not even a very large server. Creating a symlink is just kicking the can down the road. I’m running in docker, so I’ll have to possibly create a custom docker config, which I am not really trying to get into.

The root of the issue is that there is a mechanism in Plex that is taking up hundreds of GB of space for we don’t even know what for. I get that it might not be possible to change the core of whatever is being used for this data to just not uses hundres of GB for cache. But something to tweak that retention schedule might be easier to implement quicker. So if I could make it, Weekly, 14 day retention, or something more aggressive might be good enough for now.

That seems wrong then. My folder is only 4 GB in size. Just go ahead and delete everything inside that folder. They will get recreated as needed. Watch this and see if there is a time when this starts to really expand.

Mine is 20GB

Hmm, something is going on then. I have to manually delete about once every 3-4 weeks or it fills up a 128GB drive. I’m currently sitting at 30GB and I think I cleared this out less than a week ago.

Are you are sure you are only looking at the PhotoTranscoder folder?

Yeah, full path is.

image

30 GB seems about right. It shouldn’t be getting much bigger than that.

I wonder if you or any of your users are using a web browser set to clear it’s cache after every sessions. That will cause Web to appear to be a new client every time it is used and will generate a new set of cache photos. Do this every day or possibly several times a day and this cache will fill up.

Hmm. Yeah it for sure will fill up the whole drive which would put this directory at ~100 GB. Ive had the whole server crash about 10 times from this. I am 100% certain that its all this directory. Ive been using ncdu to check. Its in docker using image: plexinc/pms-docker

I wouldn’t know if any of my friends are clearing their cache on their browser or not. So this cache is generated PER client? Not just a general cache that everyone uses? Interesting. I mostly use Roku Client.

I just checked the stats and I have 6 unique users in 30 days with 24, 14, 8, 11, 2, 1 plays. So its not super hammered. Can anything happening in or to the folder that holds all the media cause the cache to fillup?

Yes, the cache is per client. These are all the small images the client uses so it doesn’t have to d/l the originals everytime it accesses the server. The client will save a copy locally but if it can’t use it’s own, then it requests this copy from PMS. Different clients may request different image sizes/shapes to match the client better. It also saves the client from having to resize the photos themselves so the client app will be faster.

Keep in mind that these photos are created just by the user navigating the clients, they don’t have to play anything.

Feature request: share these between clients?

I’m surprised and super curious about it being implemented that way.

Yeah I agree, even 20GB on average seems large for some static image assets. It might be better to store it based on resolution. If the resolution exists locally it uses it, if not, it requests it from the server and it caches that requested resolution server side on unique resolution request. This would be valid for all clients regardless of session. Per client - possibly per session seems extreme. I would maybe cache per-user, if not globally. I feel like there has to be a reason for this.

Basically the client requests titleimage_xxx_yyy.png if it exists, use the cache, if not, generate titleimage_xxx_yyy.png and cache it globally.

I do notice the server (via my roku client) being very slow generating thumbnails recently (last 3 months) even with this large cache. Maybe all of this is related.

I also asked the people who use the server and only one is using chrome and said they are not using any kind of session clearing software or clearing cache. The other clients are firestick and roku.

1 Like

I disagree. That sounds way too much.
Why is this per client and not per resolution? Does this generate the same thumbnail 10 times for 10 clients? Is this due technical limitations?

If the Scheduled task says “clean weekly” it should be week old and not month old that gets cleaned.

This should also be triggered by size not by age alone.

And maybe most importantly:

A Client clearing its local cache daily should not impact my plex server in a way that fills up my drive and makes it crash. That’s a potential attack scenario.

I just wanted to make a quick note that its now grown to almost 100GB.

Look around and see if there is any specific folder in there that is causing this.

Edit - My thought is that something is putting things in there that aren’t actually photos.