Hey guys, for intro detection it seems there is a lot of data going in and out of the /tmp dir. 0.2-0.8G per Episode. That’s Terrabytes of data going over the SSD (in my case)
Why not restrict this to some dir inside the plexmediaserver dirstructure, Cache or Transcode comes to mind, so one could plan for it and not kill the ssd?
/tmp ist just a subdir, per default, unless it specifically mounted otherwise, which may be the case on some distributions but it’s certainly not the norm.
/ is a ssd, in my case.
Where can I look up PMS transcoder settings and service overrides you are speaking of?
I don’t think I have any.
Also which of the logs?
Something to consider with SSDs, the noatime option saves a great deal of writing to the SSD. Linux will no longer update the last-accessed-time field of a file or directory every time you access it. That’s a lot of page writes saved in very short order.
EDIT: Here’s one user where tmpfs is the default.
If I look at my system, you can see the system defaults and my mount
I looked into Preferences.xml, I have no TranscoderTempDirectory set.
I tried setting it but it only affects the transcode sessions, which go inside the plex dir per default anyways.
Can you make the intro detection/deep analyse respect this setting as well please?
p.s. The picture you posted with the default 100M /tmp directory would probably result in lots of errors with the current usage of plexmediaserver in /tmp for intro detection, which is almost 1G per episode for me and i only have 720p.
p.p.s RPI may be a bit of a special case
p.p.p.s my rpi with raspbian has no tmpfs /tmp dir
As I said above, we’re going to clean up the confusion caused in the new packaging.
Having traced it all down back to the beginning of time (2011) for Linux.
TMPDIR was always used (for POSIX compliance) 0
TranscoderTempDir is not set by default. If you want that, you can set in Preferences.xml or in the GUI (transcoder - show advanced)
When PMS was first ported to Linux and the team setup the variables, they made plans for having all nice names. PLEX_MEDIA_SERVER_TEMPDIR was supposed to be included.
In the initial start_pms script, it was used, if defined, by
TMPDIR="$PLEX_MEDIA_SERVER_TMPDIR"
The transition from SYSV -> Upstart -> systemd lost that functionality in systemd.
When I re-introduced SYSV-init support, I accidentally brought it back.
It was never supported in the first place.
Official has always been to set TMPDIR, or any of the four honored by mkstemp() prior to PMS launch .
What will happen now is I’m going to clean up this perpetuation of an error because there is no way for us to selectively pick variable names in service definitions.
The solution I’m going to implement is:
I’ll set TMPDIR to the Plex default (which is per each platform’s default) /tmp
If this isn’t desired, all that’s needed is to declare a new value in override.conf or /etc/default/plexmediaserver (platform dependent)
I will also be adding some support info in the service file and default file to clarify this.
TranscoderTempDirectory which is setable via gui, has nothing to do with the TMPDIR we are talking about? And why have 2 separate directories for basically the same thing?
The transcoder defaults to TMPDIR unless you expressly set it.
Here’s how I’m writing the new /etc/default/plexmediaserver plexmediaserver.service will be similarly writtten.
Look ok?
# default Environment for Plex Media Server
# Uncomment and edit variables below as desired
# Where Plex keeps its metadata
#export PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR="/var/lib/plexmediaserver/Library/Application Support"
# The number of plugins that can run at the same time
#export PLEX_MEDIA_SERVER_MAX_PLUGIN_PROCS=6
# Limit the stack size
#export PLEX_MEDIA_SERVER_MAX_STACK_SIZE=3000
# Where Plex should perform temporary file work.
# The TranscoderTempDir can be set in either the Plex/Web GUI or in Preferences.xml
#export TMPDIR=/tmp
# the user that PMS should run as, defaults to 'plex'
# note that if you change this you might need to move
# the Application Support directory to not lose your
# media library (match what is in /etc/passwd)
# (plex_media_server_user has been retired in favor of plex_user on Debian)
#export PLEX_MEDIA_SERVER_USER=plex
# Uncomment this to use syslog for logging instead of
# sending logs to Plex Media Server.log
#export PLEX_MEDIA_SERVER_USE_SYSLOG=true
I think you meant the Scanner, since the Transcoder defaults to /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Cache/Transcode and not TMPDIR?
I don’t see a reason to have the Scanner write its tmp files to another tmp dir than the Transcoder, unless there is a technical reason I am unaware of. /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Cache/Scanner for example would be a more consistent default value and more inline with Plex’s insistence on having its own dir structure.
Also having those variables defined in a .service file makes it harder for users to edit since we need to make a copy to /etc/systemd/system/plexmediaserver.service which will not inherit subsequent changes provided by you in the package’s /lib/systemd/system/plexmediaserver.service file.
Edit:
It seems I am mistaken, it’s the Transcoder writing into /tmp while generating the Intro thingie which is even more puzzling to have 2 separate tmp dirs for the same thing. It should not use TMPDIR then but TranscoderTempDirectory which defaults to: /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Cache/Transcode
Or have TranscoderTempDirectory default to TMPDIR and not /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Cache/Transcode
This is incorrect use of a Linux service / override. Copying the entire service file isolates the installation because a fully overridden unit file will have been created when only a few variables were desired.
Please see man systemctl, specifically systemctl edit <servicename> to effect change to specific variables.
Also, please see specific examples I have provided in
I don’t think I am understanding you correctly.
Are you saying that in future releases, when I watch a Show the temporary transcode files will go in /tmp by default and not into /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Cache/Transcode anymore?