在群晖中使用了rclone挂载了阿里云和百度云,结果最近看挂载到本地的视频时经常导致群晖出现死机的情况。
实际排查时发现使用df -h 看到/tmp空间接近满了
于是从猜测是rcone 挂载把 临时目录撑爆了。到/tmp目录中查看果然发现/tmp/rclone目录下有大量的缓存文件
再查看原来的挂载命令为
rclone mount $REMOTE $LOCAL --config $CONFIG --default-permissions --allow-non-empty --allow-other --buffer-size 32M --dir-cache-time 3h --vfs-read-chunk-size 64M --cache-dir /volume1/homes/sitieqiang/rclone_cache --vfs-cache-max-size 20G --vfs-cache-max-age 24h --vfs-read-chunk-size-limit 1G --transfers 4 --low-level-retries 200 --vfs-cache-mode full --umask 000 >/dev/null 2>&1
1. 核心优化点(必须修改)A. --vfs-read-chunk-size-limit 1G -> 建议改为
B. --low-level-retries 200 -> 建议改为
2. 性能与兼容性优化(推荐修改)C. 添加 --no-checksum 和 --no-modtime
D. 添加 --user-agent "Mozilla/5.0..."
E. --buffer-size 32M (视内存而定)
最后也最为重要的修改 缓存路径
--cache-dir /volume3/FastData/rclone_cache
最后修改的命令为
rclone mount $REMOTE $LOCAL --config $CONFIG --default-permissions --allow-non-empty --allow-other --buffer-size 32M --dir-cache-time 3h --vfs-read-chunk-size 64M --cache-dir /volume3/FastData/rclone_cache --vfs-cache-max-size 20G --vfs-cache-max-age 24h --vfs-read-chunk-size-limit 128M --transfers 4 --low-level-retries 10 --vfs-cache-mode full --no-checksum --no-modtime --umask 000 >/dev/null 2>&1 &
搞定 连接速度飞快

