I should call this thread "roast my garbage service file" because I've cobbled it together from other people. Here's my usecase:
google drive connected to Jellyfin holding media.
server has 30gb of free space, low powered vps
connection is 480Mbsp up and down
My service file, if anyone has thoughts on what to add / remove to help videos load more quickly play reliably, I'm all ears. Bonus points if you could educate me as to what I am changing and why. TIA.
[Unit]
Description=RClone Media Mount Service
After=network-online.target
[Service]
Environment=RCLONE_CONFIG=/home/xxxxxxx/.config/rclone/rclone.conf
RestartSec=5
ExecStart=/usr/bin/rclone mount gdrive:xxx /home/xxxxxxx/media \
--allow-other \
--umask=002 \
--vfs-cache-mode full \
--vfs-cache-max-size 20G \
--vfs-cache-max-age 15m \
--vfs-read-ahead 2G
ExecStop=/usr/bin/fusermount -uz /home/xxxxxxx/media
Restart=on-failure
RestartSec=10
User=ubuntu
Group=ubuntu
[Install]
WantedBy=multi-user.target
It looks ok but I would increase --vfs-cache-max-age. 15m is definitely wrong. If you use cache keep data there as long as possible so set it to e.g. 9999h
Gdrive is polling remote so you can also add --dir-cache-time 9999h
I tried the updated file you suggested, it's now throwing an error:
Subject: Unit process exited
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░
░░ An ExecStart= process belonging to unit rclone.service has exited.
░░
░░ The process' exit code is 'exited' and its exit status is 1.
Sep 14 11:58:56 jellyfin-gdrive-optimized rclone[21769]: Failed to rc: connection failed: Post "http://127.0.0.1:5575/vfs/refresh": dial tcp 127.0.0.1:5575: connect: connection refused
Sep 14 11:58:56 jellyfin-gdrive-optimized systemd[1]: rclone.service: Control process exited, code=exited, status=5/NOTINSTALLED
░░ Subject: Unit process exited
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░
░░ An ExecStartPost= process belonging to unit rclone.service has exited.
░░
░░ The process' exit code is 'exited' and its exit status is 5.
Sep 14 11:58:56 jellyfin-gdrive-optimized systemd[1]: rclone.service: Failed with result 'exit-code'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░
░░ The unit rclone.service has entered the 'failed' state with result 'exit-code'.
Sep 14 11:58:56 jellyfin-gdrive-optimized systemd[1]: Failed to start RClone Media Mount Service.
░░ Subject: A start job for unit rclone.service has failed
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░
░░ A start job for unit rclone.service has finished with a failure.
░░
░░ The job identifier is 3702 and the job result is failed.