Skip to content

Set a timeout for dropping in-memory rclone mount buffer #5592

Open

Description

@agneevX

The associated forum post URL from https://forum.rclone.org

https://forum.rclone.org/t/rclone-mount-buffer-not-filling-when-playing-large-files/26405/

What is your current rclone version (output from rclone version)?

rclone v1.56.0
- os/version: ubuntu 20.04 (64 bit)
- os/kernel: 5.4.0-1042-raspi (aarch64)
- os/type: linux
- os/arch: arm64
- go/version: go1.16.5
- go/linking: static
- go/tags: none

What problem are you are trying to solve?

# rclone mount config
Environment=RCLONE_UMASK=002
Environment=RCLONE_ALLOW_OTHER=true
Environment=RCLONE_POLL_INTERVAL=10s
Environment=RCLONE_DIR_CACHE_TIME=1000h
Environment=RCLONE_USE_MMAP=true
Environment=RCLONE_PACER_MIN_SLEEP=10ms
Environment=RCLONE_DRIVE_PACER_BURST=200
Environment=RCLONE_RC_ADDR=0.0.0.0:5801
Environment=RCLONE_RC_ENABLE_METRICS=true

rclone mount crypt: /mnt/rc-crypt \
	--vfs-cache-mode writes \
	--vfs-read-chunk-size 64M \
	--buffer-size 700M --rc
# I've tried variations of the chunk size and buffer size

Buffering during playback of high bit rate files on Plex that occur due to the Plex client "dropping" the file, which causes rclone to also drop the in-memory cache for the file.

Since it takes some time to again download the chunks, there's wastage of data due to the dropped buffer and there's buffering visible in the Plex client.

Log file: https://www.dropbox.com/s/i7m51jsjsk6nbie/crypt.txt?dl=0

Significant data over use (~50%):

How do you think rclone should be changed to solve that?

An option to set a timeout for dropping in-memory buffers set by --buffer-size rather than dropping it immediately, when the file is "closed" by the Plex client.

EDIT: Add images and rclone mount config details
EDIT 2: Resize images

How to use GitHub

  • Please use the 👍 reaction to show that you are affected by the same issue.
  • Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
  • Subscribe to receive notifications on status change and new comments.

Activity

  1. ivandeex commented on Sep 10, 2021

    @ivandeex
    Member

    Please point to the bug report for "Plex client dropping the file".
    Dropping files is not good.

  2. agneevX commented on Sep 10, 2021

    @agneevX
    Author

    @ivandeex I've updated the post with a link to the log file.

  3. ivandeex commented on Sep 11, 2021

    @ivandeex
    Member

    Based on
    https://forum.rclone.org/t/rclone-mount-buffer-not-filling-when-playing-large-files/26405/17
    the enhancement will be useful at least in the niche case where:

    • rclone device has no usable disks or sdd
    • memory is limited
    • a dumb / stock Plex player or alike is used for streaming

    A future patch must clearly specify these conditions in the documentation for new flag!

    Volunteers welcome!

  4. added this to the Known Problem milestone on Sep 11, 2021
  5. ncw commented on Sep 13, 2021

    @ncw
    Member

    Did you try using --vfs-cache-mode full? That will effectively save the chunks to disk so that when the file is re-opened the chunks should be read off disk.

    You can then turn --buffer-size down to small again.

    If you want you can point the vfs cache at a RAM disk and limit its size.

    That would be my recommended solution.

  6. agneevX commented on Sep 13, 2021

    @agneevX
    Author

    If you want you can point the vfs cache at a RAM disk and limit its size.

    Yes, I've tried that but when a single file fills the RAM cache, no other file can be opened, until the current open file is purged.

    I've written about in in the forum.

    If you've got a better idea, I'd love to hear it.

  7. ncw commented on Sep 13, 2021

    @ncw
    Member

    Try it with the VFS cache pointed to disk. Your OS will do caching of files in RAM so it should be just about as quick as the RAM disk for recently used files and has the advantage that it can be bigger.

  8. agneevX commented on Sep 13, 2021

    @agneevX
    Author

    Right, but there's still activity on the disk and its not entirely done in RAM?

    My feature request is to simply not drop the cache when a Plex client drops it and set a timeout for that, similar to the mergerFS dropcacheonclose parameter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions