ACD + fuse mount: still not working with Plex

Interesting result!

I set that value to the default as I didn’t have any other info as to what it should be.

It might be that the default value should be bigger for rclone so I’d be interested in the results of experiments setting it to bigger and smaller values.

After some testing with 1M, 10M, 50M, 100M, and 200M max-read-ahead, I notice incremental improvement to video playback with each increase in size, though there might not be a noticeable difference between 200M vs. 100M. Improvement to video playback includes max birate that’s playable, video start time, buffer time when skipping/rewinding, and time to resume video. For now I’m going to stick with using 200M. BTW I’m mounting encfs decryption on top of rclone fuse mount (not using crypt).

So I’m using this now:

rclone mount --max-read-ahead 200M --transfers 20 --checkers 40 --verbose --read-only --debug-fuse --allow-other  acd:remote/ /mnt/local/folder

I’m currently I can smoothly playback video at 40Mbps birate without significant buffer using a ethernet connected FireTV running Plex. I’m located in the US and Plex server in located in EU.


@ladude626 20M or 200M? And what difference did it make to remove “–no-modtime” ?

@ncw where is the --max-read-ahead data stored? In RAM only or is anything temporarily written to disc?

@hari9 Sorry I meant 200M. I didn’t seen any difference in performance with --no-modtime remove (with it you can’t tell when files was modified when browsing).

Thanks for testing - very useful.

I’ll note that --transfers is ignored by rclone mount. --checkers is used to control the parallelism of directory listings though.

You will probably get a bit more performance turning off --debug-fuse and --verbose when you are happy.

Do you think I should change the defaults? Does anyone know what the defaults in other fuse filing systems are?

It is stored in the kernel buffer cache I think. So if you do free -m it is part of the buff/cache column

              total        used        free      shared  buff/cache   available
Mem:          15936        7429         294         838        8211        7247
Swap:         16267         233       16034

I’d vote for upping the default --max-read-ahead
I’m going to test today with:
rclone mount --max-read-ahead 200M --checkers 40 --read-only --allow-other acd:folder /folder

Or perhaps it be made a factor rather than a preset value. I was reading this in the linux kernel. That way it is small for small reads and large for large reads by some factor. Perhaps make the flag take something like 4x or 8x in addition to static 4M or 8M parameters. In streaming that would help high bit rate movies pull larger read aheads while smaller bitrates would use less. Something like this:

There are three phases in a typical readahead sequence:
initial When there exists no current_window or ahead_window, the size of initial readahead
is mainly inferred from the size of current read request. Normally readahead_size will be 4 or 2 times read_size.
ramp-up When there is a previous readahead, the size is doubled or x4.
full-up When reaching max_readahead.

It is possible to jump directly into full-up phase, if the request size is large enough (e.g. sendfile(10M)).


1 Like

That makes sense. According to this document the max_readahead is determined by the kernel.

Yes. In our implementation I would just say we optionally control the “max” with a flag as well with some sane default…

What you’re talking about is file cache heuristics, which indeed would be a neat addition for cacheing (acd_cli already does this). I’m sure @ncw would want an issue at Github to track it properly :slight_smile:

Normally an heuristics anticipates if more data is needed and adjusts the cache accordingly (by upping the cache limit and requesting more data from the source to fill the cache)

Nice work

I set mine too --max-read-ahead 400M, I was still getting choppy playback at times.

So I set the system buff/cache to use 45G now I have smooth playback.

really happy have watched 5 movies no issues .

Can you explain now to adjust the cache?

I have 60 GB ram in the box so really you want to allocate about 75% of free ram max

how much memory do you have ?

Only issue I have now, is I need faster internet at home :slight_smile:

#buff/cache change

I just added this to my crontab so at reboot it runs

@reboot root dd if=/dev/zero of=~/plex bs=1M count=45000


I use crypt

rclone/rclone mount --max-read-ahead 400M secret: /Plex/Media


Plex setting due to some 4k content had to transcode.
(still testing but look good so far)

Segmented transcoder timeout
Timeout in seconds segmented transcodes wait for the transcoder to begin writing data.

Transcoder temporary directory
Directory to use when transcoding for temporary files.

Transcoder default duration
Duration in minutes to use when transcoding something with an unknown duration.

Transcoder default throttle buffer

I’ve got two questions:
(1) If I only have 8GB of RAM you’d still recommend me setting the cache to 5-6GB?
(2) How do I add that to a mac?

use 5 and see how it goes

I follow this guide to tune my Linux server and it seem to help with buffer also:

1 Like

I’ll give it a go once I figure out how to change it in macOS.
Any hints?

Do you have a reference for this? This seems to just create a file called plex in a home directory. I’ve been trying to find a reference that plex will use this as a bufffer but have been unable to.

Yes that’s correct splice to disk pagefile. Post it later when home . But look up dd buffer cache .

And plex is using It.

Before I play a movie I have a few k Listed under buffer when I play a movie it grows too the size of the movie