Best mount settings for streaming ( Plex )

Correct OverlayFS gives me better performance. Using solely ssd and acd.
Will need kernel 3.18+ to run this. If running in VMware then anything above 4.4 will not run as there are bugs.
Will upload new mount scripts to GitHub and some instructions for OverlayFS shortly.

1 Like

Looking forward to the script and instructions:)

I think the idea of Rcloneā€™s mount feature is awesome and keeps getting better. I hope one day soon it will be a permanent replacement for acdcli as I personally like not having to rely on an additional dependency to get a ā€œtypicalā€ plex setup.

Unfortunately, I have not been able to replicate the success I had with acdcli with rclone in terms of mounting with encfs and unionfs. Iā€™ve followed this thread over the last 2 months trying different commands, but no matter what, for some reason rclone is considerably slower for me when using Plex. If I try to play a video file, acdcli with load it quickly and usually will not need any buffering whatsoever. When I try with rclone, it might take 30 seconds for the video to play which is fine, but then it stutters and/or buffers throughout (same file was tested at roughly same time of day).

I am using a dedi ovh north america connected to acd USA west serverā€¦ the transfer speeds appear to be good with both rclone and acdcli. Based on reading on this forum and reddit, I feel like I must be doing something wrong as the general feeling I have been getting is that many people have converted over to rclone mounts.

I donā€™t have a huge library (under 8 TB), but is the general consensus that rclone mount is superior to acdcli? I know asking on an rclone forum might present biased opinions lol, but Iā€™m just trying to identify what might be going wrong with my setup.

I apologize if this is a dumb question - I am rather new to linux, but have been learning so much over the lasts few months, but does anyone know what a ā€œtraditionalā€ Plex ACD setup consists of?

Iā€™ve seen mentions on reddit and here that unionfs might present a performance issue. Iā€™ve seen some also say theyā€™ve reverted to a ā€œtraditionalā€ Plex ACD setup as they felt unionfs complicated things and caused issues.

I always thought a ā€œtraditionalā€ Plex ACD setup (with encryption using encfs) consisted of an acd remote encrypted mnt, acd remote decrypted mnt, and 2 local folders encrypted/decrypted that are used to transfer to ACD.

Every guide I have read talks about setting up Plex/ACD with a unionfs folder that merges the local and ACD drive to one directory.

Are there other ways of possibly mounting? Maybe pointing Plex to the ā€œACD Decryptedā€ folder as well as the local decrypted to avoid unionfs?

Hey @joebeem

I have a server with OVH in Canada (the SP-32) with an rclone mount and crypt on ACD (US). Performance has been rock solid for me except for the long start up times. I think itā€™s a limitation with rcloneā€™s FUSE implementation.

I still have my old scripts to use with acd_cli + rclone crypt (Iā€™ve never used EncFS) and I can echo your sentiments. acd_cli would load videos significantly faster than rclone mount + crypt. Iā€™m not sure why this is, I think @ncw has some theories, but all of us here on these forums have experienced some issues with Plex + rclone + crypt + ACD.

Avoiding UnionFS will not really reduce performance. There are some mount options to unionfs that make the performance about the same as normal.

The reason I chose crypt over EncFS is due to the leakage that is known for EncFS. itā€™s not as secure as crypt. Yes I have my tinfoil hat on, but thatā€™s just what it is.

So you could do something like this (which is what Iā€™ve done in the past) and you may get better performance:

  1. Mount your ACD via acd_cli to ~/.media/acd-encrypted
  2. Mount a local crypt remote in rclone which picks up the files in~/.media/acd-encrypted and puts them in ~/.media/acd-decrypted
  3. Use UnionFS to merge ~/.media/acd-decrypted and ~/.media/local into a single folder, i.e: ~/media
  4. Point Plex at ~/media

I did this for 2 months and performance was better, but itā€™s more complex and more things can go wrong.

I decided to deal with the slow startup speeds (and also very slow resume speeds - i.e: if I resume playback in Plex from half way through, it can take a minute or so to start) because I wanted to simplify the setup.

I think your question of ā€œtraditionalā€, purely from a historical sense would have been acd_cli + encfs, because I think the first adopters of a Plex on a remote server only had this to use. Most of us in the forums use purely rclone (crypt)+ACD+unionFS, thatā€™s the more widely used solution here.

Thank you very much for the informative post.

If it were just rclone taking a long time to start, Iā€™d have no issue with it at all. Considering it is a free tool, I canā€™t really complain and didnā€™t intend for my comment to sound that way. I think rclone is a great tool that Iā€™d like to use in place of acdcli.

However, unfortunately for my scenario, itā€™s more than just slow start times. My observations have been that Iā€™d need to buffer throughout a file when mounted with rclone whereas with acdcli, the same file will playback flawlessly with zero buffering. The testing has been run at roughly the same times and Iā€™ll always test the same random file each time with rclone and then acdcli.

I donā€™t mean an occasional buffering here and there, but itā€™s more like every few minutes or so regardless if I pause Plex for a bit or not. I assume when Plex is paused, the grey background on the progress bar indicates some kind of buffer, but Iā€™m not sure.

@Stokkes youā€™ve got a great ovh machine. I had to settle with an SYS E3-SAT-1 which doesnā€™t have the same bandwidth and power as the enterprise line. Iā€™m not sure if that has anything to do with it.

Thank you for the recommendation, Iā€™ll give it a try.

Thank you to everyone that contributes here, itā€™s really a great community.

@joebeem

Iā€™ve spun up so many machines (Hetzner, Online.net, Linode, Kimsufi, SoYouStart, OVH-Proper) and the biggest recommendations I can give is having an SSD, Optimizing the sqlite datebase by increasing the page cache and ensuring your server is as close to you geographically as possible.

I have spun up the E3-SAT-1 on SYS and I experienced the exact same issues. A few things you can try on your server:

  1. For the transcode folder, set plex to use your /dev/shm device, which will effecxtively use 50% of your RAM. Transcodes will go directly to RAM instead of the spinning disk

  2. Optimize your SQLIte database, follow the instructions here (make a backup first!): https://forums.plex.tv/discussion/254547/plex-library-performance-tip#latest This will really help too. I set mine to 2 million 2000000ā€¦ my library is 32TB.

  3. Try without UnionFS just to eliminate any layers. You can add UnionFS later if you need it.

  4. On your Plex clients, disable DirectPlay and DirectStream and do some tests with that.

Hopefully some of this will improve your performance.

@Stokkes Is your current configuration stable and performing well?

@joebeem

Yes, I would say itā€™s quite stable. Itā€™s not perfect, but from the feedback Iā€™ve received from my family/friends that use Plex, itā€™s been good. They report some issues, but others are simply due to their network at home (using wifi to stream, which can be flakey, etc.)

I am the primary user of my Plex server. I used to host everything on-site. Is it as good as that? No. Do streams take 10+ seconds to start? Yes. Do streams sometimes stop or buffer in the middle? For me, itā€™s very very minimal.

I donā€™t have a lot of patience when it comes to getting my watching experience interrupted. When I see that happen, I will work and do whatever I need to get it working. Hence the multiple servers, etc that Iā€™ve spun up.

I tell myself, if Iā€™m not satisfied with the experience, how can I expect my family/friends to be?

Also, use PlexPy - itā€™s your friend and can give you a lot of information, for example (and Iā€™ve mentioned this before, not sure whereā€¦

If youā€™re buffering, check PlexPy:

  • Are you going via DirectStream/DirectPlay? If so, try turning it off
  • Are you transcoding? If so, how far is your buffer compared to the playback progress?
  • Having a buffer of 5-10 minutes (configurable in Plex) for transcodes will help if your ACD connection gets spotty
  • Turn on the PlexPy notifications for when a user is buffering (I use Pushover for notifications, but there are many other ways through PlexPy to notify you in real-time).
  • If PlexPy shows a buffer of 5-10 minutes but you are still buffering on your Plex client, it isnā€™t an rclone/ACD problem, itā€™s the connection to your Plex server from your client
  • If PlexPy does not show a buffer or shows a tranxcode speed of less than 1.0, then it could be an issue with your connection to ACD from your Plex server or even your disk (it canā€™t write the buffer fast enough)
  • If PlexPy does not notify you of a client buffering (it doesnā€™t always), you can check the Start Time/End Timeā€¦ Add those numbers up, youā€™ll get the total time (substract the time paused, if any) and then check how long your episode/movie is. For example and to make it easy, if your start time is 1:00 and your end time is 1:45, you did not pause, but your episode is only 42 minutes, you know youā€™ve ā€œlostā€ 3 minutes to buffering. I have some family/friends and this happens when their wifi at their home gets spotty and canā€™t sustain the speed required to stream.

Iā€™ve leveraged all the above in my troubleshooting and itā€™s been invaluable.

Cheers,

Saw something interesting last night. Wonder if ā€œclientsā€ also play a factor here as well. The same show that was having issues direct play via firetv plex app was having no issues playing via kodi through plex add-on. Both were direct play. FireTV plex app starts off and within seconds you get the ā€œyou connection to the serverā€ message and it buffer/hangs. Then throughout the lost connection messageā€¦ I switched back and forth between the two so rclone buffer could have had a factor but it was pretty obvious kodi through plex played better.

Made some change to plex transcoder settings which seem to have help a lot. Movies are basically starting almost instantly. Rclone mount is just --allow-other --buffer-size=1G ā€¦ Essentially it is all running in memoryā€¦ Rclone mount with 1G buffer, the transcode file is in /dev/shm = memory. I also have hardware enabled transcoding on the box which has 32G of ram.

Segmented transcoder timeout
120
Transcoder temporary directory
/dev/shm
Transcoder default throttle buffer
1800

Since my original topic is way to huge I will update the wiki bellow with all best finds. https://github.com/ajkis/scripts/wiki/best-plex-rclone-mount-settings

1 Like

@EnorMOZ

Do you host your own server or do you have a cloud server? If itā€™s cloud, mind sharing which provider?

Also, which CPU for the hardware transcoding? Iā€™ve noticed the newer Plex releases have this now. Do you also have a GPU in your server?

Cheers,

Dedicated server providerā€“1Gbps i7-6700k 32G ram enabled igfx via bios for hardware transcoding. Library is on ACD with rclone crypt. The i7 has an integrated gpu which is what is being used for the hardware transcoding. I am going to tweak those settings some more since the 30min buffer is probably excessive especially if there will be multiple people transcoding. But so far those settings work.

@Ajki the 1800 is probably excessive and will most likely eat up the ram pretty quickly if you have several transcoding sessions going. I have seen it take 4-6g of space. Not sure what would happen if /dev/shm would run out. I was testing with 1-2 sessions. Figured would set it high just to see what happens. It should probably be lowered.

Yea I changed it back to 600 like i had before, and fixed in wiki.
Did some testing with it now with this movie:

After running movie for 12 minutes its stabilized at 2GB ( it may still go up will see )

And this was just one fully transcoded stream with Prefer Higher Quality

Probably a really good idea to backup your Plex DB daily, rclone crashed and Plex scanned and I lost my entire library going to take days to rescan at this rateā€¦

@toomuchio

Itā€™s generally a bad idea to enable the Empty trash automatically after every scan

If this wasnā€™t enabled then you wouldnā€™t have had to redo your library.

Edit
This is a Plex option available in Server settings -> Library

Edit 2
Plex does do backups of the DB every 3 days if you havenā€™t deactivated this funciton (itā€™s on by default).

The backups are in:
/Library/Application Support/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db-YYYY-MM-DD

Oh my god thank you so much for that! Restored and option disabled! :slight_smile:

Yea it happened to me as well in early days and acd_cli db corruption and mount disconnects.
That one was one of the first setting I disabled in Plex.