Best practice Jellyfin with Onedrive (business)

Hey guys,

I'm running a Jellyfin Server with 50 TB+ of storage (a few sharepoint shares connected) and watched the rclone debug log for a long time now, hoping not to trigger the pacer...here are my conclusions:

Setting up jellyfin at first needs to scan the whole library, surfing through each folder and file and build up an index, while transferring a LOT of small files. (metadata) means a lot of queries in a short period.
-> Consider using your local storage OR a remote share with FTP by 10 connections allowed in parallel. Saving this on remote like Onedrive shares causes slow browsing experience for the user, and triggers the pacer pretty fast....

Conclusion 1: Metadata -> FTP (or some other fast remote other than providers with query limit)

then, serving videos is done by onedrive business shares.
You need to limit the transactions (tpslimit), before getting the pacer skyrocketing way beyond 5m cooldown.

by scanning the library I often hit the limit and started the tpslimit with parameter "20".
The scans went fast but hits the pacer pretty early....
Then I decreased the number one by one (I often started again scanning) until I landed at "3", with almost no triggering a pacer.

Conclusion 2: Video remotes -> tpslimit 3

tpslimit = 3 is still a good compromise between streaming videos fast and scanning metadata in an acceptable time period.

right now remote mounts have the following parameters and going fine with it.
I build them as a service

Sadly I can't give you any experiences for onedrive personal...I personally don't use it

hope it helps someone, someday building with onedrive business / sharepoint :slight_smile:

[Unit]
Description=rclone: Remote FUSE filesystem for cloud storage config %i
Documentation=man:rclone(1)
After=network-online.target
Wants=network-online.target
AssertPathIsDirectory=%h/mnt/%i
StartLimitInterval=200
StartLimitBurst=5

[Service]
Type=notify
Environment="RCLONE_CONFIG_PASS=mypasswordforconfig"
ExecStart= \
  /usr/bin/rclone mount \
    --config=%h/.config/rclone/rclone.conf \
    --log-level INFO \
    --log-file /root/logs/rclone-%i.log \
    --umask 022 \
--vfs-cache-mode full \
--allow-other \
--no-modtime \
--cache-dir /root/rclone/cache \
--no-checksum \
--ignore-checksum \
--no-check-certificate \
--checkers 3 \
--tpslimit 3 \
--transfers 3 \
--dir-cache-time 12h \
--ignore-size \
--user-agent "ISV|rclone.org|rclone/v1.62.2" \
--vfs-cache-max-size 10G \
    %i: %h/mnt/%i
ExecStop=/bin/fusermount -u %h/mnt/%i
Restart=always
RestartSec=30

[Install]
WantedBy=default.target

Hey friend!!

I ran into this problem a while ago and what worked for me was:

  • If you use remote Crypt, I recommend that you change the filename encoding to base64 or base32768.
  • mount the remote as below example
[Unit]
Description=Onedrive (rclone)
AssertPathIsDirectory=/mnt/rclone/Onedrive
After=Onedrive.service

[Service]
Type=simple
ExecStart=/usr/bin/rclone mount \
        --config=%h/.config/rclone/rclone.conf \
        --allow-other \
        --cache-dir=/tmp/rclone/vfs \
        --no-modtime \
        --stats=0 \
        --bwlimit=30M \
        --dir-cache-time=120m \
        --vfs-cache-mode full \
        --vfs-cache-max-size 20G \
        --log-level DEBUG \
        --log-file /var/log/Rclone/Rclone-Onedrive.log \
	--read-only \
#	--vfs-read-chunk-size 32M \
	--user-agent "ISV|rclone.org|rclone/v1.62.2" \
        --onedrive-no-versions \
        --tpslimit 2 \
	--cache-info-age=60m Onedrive:/ /mnt/rclone/Onedrive
ExecStop=/bin/fusermount -u /mnt/rclone/Onedrive
Restart=always
RestartSec=10

[Install]
WantedBy=default.target

In this example, Onedrive will be mounted as read-only. As my own experience, Onedrive does not handle small files well and when scanning libraries Jellyfin ends up storing the metadata in the content folder and in doing so it will not store them.

Now, if you usually send files for assembly, I recommend that you create a service in systemd Linux to start Rclone's WebGui and transfer the files through it, so you won't have the limitation problem.

Onedrive does not handle small files well and when scanning libraries Jellyfin ends up storing the metadata in the content folder

That's why I wrote, find another place than onedrive itself for metadata. It is indeed a bad idea to store metadata in the videos content folder. I have it remote in one place via FTP. works fine and fluent :slight_smile:

Right now I don't use "read only" for the shares. I can't see any differences in performance....

If you use remote Crypt, I recommend that you change the filename encoding to base64 or base32768.

Yes, it is adviced to use crypt remotes, as microsoft is known for scanning the contents...

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