How long should maintenance on a ~500GB repository (85k snapshots) take?

I have a repository that’s around 500GB in size and had 85k snapshots.
I have recently deleted 55k of them, so there are 30k snapshots left.

Because of a misconfiguration, maintenance wasn’t run for over a year.

> kopia maintenance info
Owner:######
Quick Cycle:
  scheduled: false
Full Cycle:
  scheduled: true
  interval: 24h0m0s
  next run: 2023-02-24 01:59:35 CET (in 19h50m36s)
Log Retention:
  max count:       10000
  max age of logs: 720h0m0s
  max total size:  1.1 GB
Recent Maintenance Runs:
  cleanup-logs:
    2021-11-19 20:14:27 CET (0s) SUCCESS
    2021-11-17 08:08:28 CET (0s) SUCCESS
  full-delete-blobs:
    2021-11-19 20:14:27 CET (0s) SUCCESS
  full-drop-deleted-content:
    2021-11-19 20:14:26 CET (0s) SUCCESS
  full-rewrite-contents:
    2021-11-17 08:08:28 CET (0s) SUCCESS
  snapshot-gc:
    2023-02-23 01:59:35 CET (22m32s) SUCCESS
    2023-02-22 22:48:54 CET (50m12s) SUCCESS
    2023-02-21 14:38:43 CET (1h32m39s) SUCCESS
    2021-11-19 20:13:14 CET (1m12s) SUCCESS
    2021-11-17 08:08:28 CET (0s) SUCCESS

I first ran a quick maintenance, which finished in a few seconds. (Though I’ve read in another thread that quick maintenance is basically obsolete with the new repository format).
I’ve been running the full maintenance for a few hours now, without much visible progress:

> kopia maintenance run
Running full maintenance...
Looking for active contents...
Looking for unreferenced contents...
GC found 0 unused contents (0 B)
GC found 7523866 unused contents that are too recent to delete (265.6 GB)
GC found 2915885 in-use contents (237.3 GB)
GC found 92509 in-use system-contents (52.6 GB)
Rewriting contents from short packs...

I understand that the snapshot deletion shouldn’t yet affect the repository much (too recent to delete), so I’ll have to run it again later.

Checking it with process explorer (I’m on Windows), it has been running for over 5 hours, with a total (user) CPU time of 9 hours, so an average of two cores (out of 6 physical). It has some disk and network IO, but is limited on neither.

Should I just let it continue, or is there something I can do to speed it up?


Edit: actually, I believe it IS network IO limited, at least some of the time, maybe the default cache size of 5.2GB is an issue? Will it repeatedly re-download the same chunks after they get evicted?

> kopia cache info
C:\Users\U\AppData\Local\kopia\6c2c4b13183ced91\blob-list: 4 files 61.9 KB (duration 30s)
C:\Users\U\AppData\Local\kopia\6c2c4b13183ced91\contents: 186138 files 6.2 GB (limit 5.2 GB, min sweep age 10m0s)
C:\Users\U\AppData\Local\kopia\6c2c4b13183ced91\index-blobs: 820 files 369.7 MB
C:\Users\U\AppData\Local\kopia\6c2c4b13183ced91\indexes: 782 files 833.7 MB
C:\Users\U\AppData\Local\kopia\6c2c4b13183ced91\metadata: 56609 files 30.5 GB (limit 5.2 GB, min sweep age 24h0m0s)
C:\Users\U\AppData\Local\kopia\6c2c4b13183ced91\own-writes: 2 files 46 B
To adjust cache sizes use 'kopia cache set'.
To clear caches use 'kopia cache clear'.

Well, it finally finished after 32 hours :partying_face:

> kopia maintenance info
Owner: #####
Quick Cycle:
  scheduled: false
Full Cycle:
  scheduled: true
  interval: 24h0m0s
  next run: now
Log Retention:
  max count:       10000
  max age of logs: 720h0m0s
  max total size:  1.1 GB
Recent Maintenance Runs:
  cleanup-epoch-manager:
    2023-02-24 10:14:30 CET (5m27s) SUCCESS
  cleanup-logs:
    2023-02-24 08:51:56 CET (1h22m34s) SUCCESS
    2021-11-19 20:14:27 CET (0s) SUCCESS
    2021-11-17 08:08:28 CET (0s) SUCCESS
  full-delete-blobs:
    2021-11-19 20:14:27 CET (0s) SUCCESS
  full-drop-deleted-content:
    2023-02-24 08:51:35 CET (21s) SUCCESS
    2021-11-19 20:14:26 CET (0s) SUCCESS
  full-rewrite-contents:
    2023-02-23 02:22:08 CET (30h29m27s) SUCCESS
    2021-11-17 08:08:28 CET (0s) SUCCESS
  snapshot-gc:
    2023-02-23 01:59:35 CET (22m32s) SUCCESS
    2023-02-22 22:48:54 CET (50m12s) SUCCESS
    2023-02-21 14:38:43 CET (1h32m39s) SUCCESS
    2021-11-19 20:13:14 CET (1m12s) SUCCESS
    2021-11-17 08:08:28 CET (0s) SUCCESS

Have you checked, how many of those snapshots are duplicates? I just decided to change my policy to not save dupliacte snapshots, since my repo aquired approx. 196k snapshots over the last year and Kopia had run into some issues, because of that.

In the end it turned out, that my repo only had approx. 18k individual snapshots and I am in the process of removing the duplicates, which will run for a week, I guess.