WebDAV mount extremely slow when file list grows in a directory.
We use rclone to access a directory in Nextcloud and write files which are synced to clients in real time, and works perfectly! Issues arise when the file list in directories grows. We noticed at some point, and for the most used path we worked around by daily moving older files to a subdirectory. Unfortunately this is not always possible.
We checked docs and ended up with this caching config which slightly improved, but didn't completely solve.
--vfs-cache-mode=writes --dir-cache-time=10s
I was wondering if there's anything else to improve the situation.
If it can be of any help, 90% of the activities performed on the mount point are writes, reads are much less frequent.
I tried adding --vfs-read-chunk-size-limit 500M --vfs-read-chunk-size 64M but didn't improve significantly.
thanks
Run the command 'rclone version' and share the full output of the command.
It may help to increase this to refresh less often from the webdav server (on the expense of less frequent updates of changes from the server performed by other mounts/processes)
I suggest you try --dir-cache-time=1h, to see if this reduces the performance degradation to only occur for 10 minutes every hour, when refreshing.
Exactly which rclone command did you use?
Was it the recursing ls, lsl or the single folder lsd or lsf?
How many items were listed?
How many items do you have in the folder with most items?
What is your available bandwidth to the webdav server?
Do you know the latency to the webdav server (using ping or similar)?
more than 13000, unfortunately the terminal history doesn't go that further.
this is one of the biggest
The Nextcloud server is local to the mount point. I know I can write directly to the filesystem, but running occ files:scan with something like iwatch is a killer, and running through cron involves an average of 30s delay.
time rclone lsf SLNextcloud:somedir | wc -l
11758
real 0m17.960s
user 0m2.047s
sys 0m0.284s
when running the command, I see mariadb/php-fpm/rclone spiking to 100% at turn, but server load doesn't go up too much.
Adding --dir-cache-time=1h indeed makes the second ls immediate. I might try with this, and educate users about the implications for the single folder we use for reading on the server.
Perfect, the trick to refresh this folder on demand/schedule is to add --rc to you mount command to allow for remote control.
Then you can refresh the folder from another terminal (on the same machine) with an rclone rc vfs/refresh command like this:
rclone rc vfs/refresh dir="gestionale-cl/aggio"
Once tested you can schedule it in Task Scheduler. I think it will be OK with 10s intervals with this very small folder, but don't think you should go lower.
Very good, I asked because I was considering to increase --dir-cache-time to something high (e.g. 48h) and then refresh the entire folder tree every night like this:
rclone rc vfs/refresh recursive=true
That would make the write folders quick all day long. The downside is that item in the tree takes app. 1K so it would make the mount use app. 700MB memory. That may be OK, that is up to you.
Another less memory requiring approach is to set --dir-cache-time=24 and only refresh the most used write folders every night.
Hope you can follow my ideas and find the optimal settings for your use, otherwise please ask.