OneDrive mount - extremely slow

Hello everyone,

New to rClone universe, trying to find some answers. Here is what I am trying to achieve:
I have a huge amount of pictures on my OneDrive but viewing them on my Android TV is always a pain. I recently setup a Jellyfin media server and I am trying to creating an OneDrive mount so Jellyfin can create a picture library for me to stream on my local network.

What is the problem you are having with rclone?

I have successfully created an OneDrive remote. After mounting the remote, opening any file via the file explorer is extremely slow. Even for files of <100Kb it takes approximately 20 seconds to open them.

What is your rclone version (output from rclone version)

rclone v1.57.0
- os/version: Microsoft Windows 10 Enterprise 2009 (64 bit)
- os/kernel: 10.0.19042.1415 (x86_64)
- os/type: windows
- os/arch: amd64
- go/version: go1.17.2
- go/linking: dynamic
- go/tags: cmount

Which cloud storage system are you using? (eg Google Drive)

OneDrive

The command you were trying to run (eg rclone copy /tmp remote:tmp)

rclone mount perisOD: O: --read-only --user-agent "ISV|rclone.org|rclone/v1.57.0"

After googling and finding some relevant issues this is what i tried and I think is important for you to know:

  1. First thing I tried is creating my own client and key as described here Getting your own Client ID and Key
  2. I decided to use read-only to optimize the cache performance. I am not interested in writing files and I have also removed the Files.ReadWrite, Files.ReadWrite.All from my registered client
  3. Also tried the suggestion of using a user agent to minimize possibility of throttling form OneDrive as described in "Excessive throttling or blocked on SharePoint" section (h t t p s://rclone.org/onedrive/#excessive-throttling-or-blocked-on-sharepoint)

The rclone config contents with secrets removed.

rclone config show
Enter configuration password:
password:
[perisOD]
type = onedrive
client_id = ***************************
client_secret = ***************************
token = {***************************}
drive_id = ******
drive_type = personal

A log from the command with the -vv flag

In the log I am trying to open a pdf file named test with a file size of 633 KB

Thank you in advance for any assistance

hello and welcome to the forum,

what does that mean?, how many files?, total size?
all in one folder, many folders, etc....

203GB, 37.591 files and 516 folders.
I should mention that I haven't tried accessing the picture library just yet. After seeing that opening small files in the root folder was so slow, I focused on solving this first. From what I have read in the docs, rClone shouldn't have an issue with my picture library.

The issue is networking or probably me not correctly configuring the mount.

how many pictures in the root folder?

onedrive is known to be slow and using windows explorer, otten, can be very slow, as it wants to display thumbnails for all files in the folder.

try opening a command prompt and viewing a single picture.

I don't have any pictures in the root folder. Mainly documents (PDFs) and folders.
Can you please elaborate on what I should try in the command prompt? I am only familiar with the mount command.

try adding --vfs-cache-mode=full to the rclone mount command.

open a command prompt, navigate to the O: drive, open a picture.

Adding the cache mode did the trick. Everything is opening in normal speeds.
Nevertheless I read a little more about the mount command in order to make it as performant as possible. As I said my goal is for the media server (Jellyfin) to create a read only library from my pictures.

So I ended up with this command:

rclone mount perisOD: O: --volname \\server\share --vfs-cache-mode=full --cache-dir "C:\rclone\cachePerisODC" --no-checksum --no-modtime --read-only --user-agent "ISV|rclone.org|rclone/v1.57.0"

A few things I don't understand quite well:

  1. I thought with --read-only there would not be a need for cache but as the test showed VFS is required to have normal speeds
  2. I don't know if rclone cleans up the cache after unmounting the remote. I added --cache-dir to check and it seems that the cache isn't purged after unmounting. So I have to clean up myself.
  3. There isn't a way to set a max cache size. I don't have unlimited space and surely I don't want rclone to download 203GB of photos on my laptop. I was hoping of setting a 2GB cache size but I cannot understand if I can achieve that with --vfs-cache-max-size.
  4. When is a file considered open?

Let me know if I can improve the mount performance in download speed or minimizing cache size.

  1. --volname \\server\share - no need for that, i would remove it.

  2. well, it is complicated. but now you know what works.

  3. the vfs file cache is persistent, rebooting the computer and/or killing the mount, will not purge it.
    rclone, on its own, will prune out files that are not open or in-use, as controlled by
    --vfs-cache-max-age duration Max age of objects in the cache (default 1h0m0s)

  4. --vfs-cache-max-size=2G.
    a. if you create a new library with jellyfin, jellyfin will scan all the pictures and for each picture, will want to analyze the entire picture and might request rclone to download all of it into it vfs file cache.
    b. if rclone thinks a file is open/in-use, then rclone will NOT prune it.
    so very easy for the vfs file cache to grow larger than 2GB.
    c. of course, the size of the jellyfin library database will grow in size, as it will create a thumbnail for each picture.

  5. a file is open/in-use, for example, when viewing a picture.

I see. It seems what I was hoping for was for a Jellyfin "streaming library" but that needs handling from their side.

I tested the setup nevertheless. I used --volname \\server\share to mount the remote with --network-mode. In network mode the explorer doesn't create thumbnails and listing directories was faster.

Jellyfin was able to create the library scanning all my directories. But loading photos was very slow. I suspect that was because Jellyfin was forcing rclone to download all the pictures. I found inside the cache some photos I didn't try to open so most probably 203GB was queued for download.

It was fun though. I had no idea about rclone and I am curious to see if I can play with it in another project, maybe setting it up in a Pi. Thanks for the help @asdffdsa

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.