Right now I’m running two instances of PMS in a single Debian VM. First one installed as usual, second one is started in a separate network namespace. DB and Meta dirs are separate, but /usr/lib/plexmediaserver location is shared.
So, I got 2 questions:
Could the latter be a potential source of issues? E.g. if any files under there should be modified and(or) locked in a manner that could result these 2 instances to conflict.
I’m having some OOM trouble in some weird cases during transcoding hard to reproduce. And I’m wondering whether it is because 2GB RAM is under provisioned or there is some memory leak. Because when I get OOM events, there is oddly a Plex Media Server process (and not Transcoder) that is occupying like 75% of Used RAM.
By my calculations 2GB could be sufficient as a single 20Mbps transcode take ~950Mb of RAM and I am allowing only 2 concurrent ones. Maybe that does not leave much for the rest of processes, but on the other hand the only transcodes that really took place were 2-4Mbps ones… For now, I increased it to 2.5GB RAM.
My ‘Plex Media Server.log’ has a lot of
[0x7f0e6bfff700] ERROR - Couldn't get size of file "/usr/lib/plexmediaserver/Resources/Plug-ins-ab5e1197c/WebClient.bundle/Contents/Resources": boost::filesystem::file_size: Operation not permitted: "/usr/lib/plexmediaserver/Resources/Plug-ins-ab5e1197c/WebClient.bundle/Contents/Resources"
[0x7f0e6bfff700] DEBUG - Content-Length of /usr/lib/plexmediaserver/Resources/Plug-ins-ab5e1197c/WebClient.bundle/Contents/Resources is 0 (of total: 0).
Issue never went away. VM RAM at 3GB.
Seems like memory leak tied to transcoding. It is ‘Plex Media Server’ process that is growing over time, but it only happens when some user (that happens to have slow throughput and thus always streams at 3-4mbit/s) utilizes transcode.
Just found ‘LogMemoryUse’ option, will try to catch it there now.
Pretty sure that it is not related to the second instance. In fact, while running simultaneously I see that only main one has the issue. And the other one never transcodes. Apart from this leak, they coexist great, I haven’t observed any anomaly. I actually never ran Plex on Debian before, it all migrated from 2 FreeBSD jails, so very well could have happened wih single PMS.
Nevertheless, I will see if I can reproduce the issue manually and try with 2nd server disabled.
This is what I gathered so far.
Couple of days ago I ran out of memory again, but logs are so filled with that annoying
[0x7f0e6bfff700] ERROR - Couldn't get size of file "/usr/lib/plexmediaserver/Resources/Plug-ins-ab5e1197c/WebClient.bundle/Contents/Resources": boost::filesystem::file_size: Operation not permitted: "/usr/lib/plexmediaserver/Resources/Plug-ins-ab5e1197c/WebClient.bundle/Contents/Resources"
[0x7f0e6bfff700] DEBUG - Content-Length of /usr/lib/plexmediaserver/Resources/Plug-ins-ab5e1197c/WebClient.bundle/Contents/Resources is 0 (of total: 0).
that all 6 log files span only last 15 hours and naturally it takes more like a week for me to start seeing OOM events. But, I managed to get to same amounts of used memory in ~10 minutes manually by simply opeing page of each movie and returning back to library page in app.plex.tv.
And this test was performed with the second PMS instance stopped, so it is not related. Network namespaces or any other means of isolation are not used with the main one, it is a basic install from your PPA. So, it seems that video transcode is what triggered OOM events as it requires large amounts of RAM which OS does not have to spare by the time leak gets it critical mass. But the leak itself relates to something like creating thumbnails or refreshing metadata as these are the obvious tasks performed on request of each media’s page.
Here are the logs, showing ‘Plex Media Server’ process going from 50mb usage after restart to ~970mb in minutes: