# Solution to slow rclone restore

**URL:** <https://kopia.discourse.group/t/solution-to-slow-rclone-restore/2259>\
**Category:** General Topics\
**Created:** [September 4, 2023, 6:49pm UTC](https://kopia.discourse.group/t/solution-to-slow-rclone-restore/2259 "2023-09-04T18:49:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mevupodi](https://avatars.discourse-cdn.com/v4/letter/m/5fc32e/32.png) [@mevupodi](https://kopia.discourse.group/u/mevupodi)\
**Post date:** [September 4, 2023, 6:49pm UTC](https://kopia.discourse.group/t/solution-to-slow-rclone-restore/2259/1 "2023-09-04T18:49:41Z")

</div>

Related to [Rclone restores very slowly](https://kopia.discourse.group/t/rclone-restores-very-slowly/162) and [SOLVED 1) Backing up the cachingDirectory beneficial? 2) cacheDirectory inner working?](https://kopia.discourse.group/t/solved-1-backing-up-the-cachingdirectory-beneficial-2-cachedirectory-inner-working/1254)

# The Issue

Rclone downloads in 20 seconds, while kopia doesn’t seem like it will ever finish.  
I took a look at `--log-level=debug` and it seems to be taking its time on copying `.git` folders which have many and very small files.

To make things worse, it seems to be using 3MiB/s to 14MiB/s of network in spikes to a microsoft ip, which is way more than the reported 600KB/s. I believe kopia is doing something very wrong for this to happen, like redownloading the repo for each file or something.

```bash
# rclone copy remote:Folder . --onedrive-chunk-size=25Mi --config=/run/secrets/rclone --progress --transfers=64
Transferred: 412.315 MiB / 412.315 MiB, 100%, 23.868 MiB/s, ETA 0s
Checks: 1 / 1, 100%
Transferred: 40 / 40, 100%
Elapsed time: 18.6s

```

[Kopia restore will never finish](https://privatebin.net/?368723481b0eca65#Bw5XCbyqGSn8CYreHrgMuQPCEULjrZPzPJsdEJRJR8Gm)

# The Solution

Use Rclone with VFS cache

```auto
kopia repo connect rclone .. \
	--rclone-args="--onedrive-chunk-size=25Mi" \
	--rclone-args="--vfs-cache-mode=full" \
	--rclone-args="--vfs-cache-max-size=1G" \
	--rclone-args="--cache-dir=/tmp/rclonecache"

```

This made my restore from probably 3+ hours to `Executed in 141.63 secs`!

#### Note

I tried `--cache-directory /tmp/kopiacache --content-cache-size-mb 900` but kopia only used 4.8MB of that cache.
