Plex Caches are sometimes counter-productive

I have two Plex servers, one running under TrueNAS Core (FreeBSD) and one running on Proxmox - LXC (Ubuntu). The one in TrueNAS has traditional hard drivers and it has been running since around 2014. The LXC one is new and it has an M2 drive but the movies and series are in the TrueNAS server, so only the Plex own data is on the M2. I knew that running Plex on an SSD/M2 would make a difference, but the difference in performance between the two systems is abysmal. So I decided to investigate what was going on. The Plex on TrueNAS is extremely slow compared to the new one.

I realized in the TrueNAS one the Cache/PhotoTranscoder folder was giant, like really big, compared to the one in the other server. So I decided to delete it and to my surprise only that made a huge difference. Of course the other server is still much faster, but the improvement in the performance is really big. Specially when browsing pictures from the Photo Library. Before it was almost unusable, now it is still slow but bearable.

Some other Caches were big and I decided to delete them all and I can see a general big difference. So this is my theory.

Those caches are organized in a bunch of sub-directories. The idea is to have Caches of pictures (art, whatever) in different sizes, or something like that. So that once you convert them you do not have to convert them again and reading the already converted version from the Cache is faster, But with the time those Caches grow very big and reading directories with way to many subdirectories is expensive. You end up with a situation in which finding the file from the cache is more expensive than converting it again. Especially with faster CPUs and slow old technology disks.

I find strange that those Caches are not cleaned up periodically, or at least not in a good way. And a parameter to define a maximum size for those Caches would be good to have, so your Plex installation does not grow out of control, specially for people running Plex inside containers or VMs.

That’s it. I hope this information is useful to some one.

P.S., I assume deleting those Caches is not dangerous, I do not assume any responsibility if something breaks.

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