From f60aa91e57ed08fb3236bf95fa87ba5fbbaf5656 Mon Sep 17 00:00:00 2001 From: Abhishek Pandey Date: Tue, 19 Dec 2023 18:19:25 -0800 Subject: [PATCH] Experiment with higher parallelism for drive --- src/internal/kopia/wrapper.go | 5 +++++ src/internal/m365/collection/drive/collection.go | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/internal/kopia/wrapper.go b/src/internal/kopia/wrapper.go index 03a4bc888..fe66d0011 100644 --- a/src/internal/kopia/wrapper.go +++ b/src/internal/kopia/wrapper.go @@ -294,12 +294,17 @@ func (w Wrapper) makeSnapshotWithRoot( Path: root.Name(), } + parallelism := policy.OptionalInt(10) + trueVal := policy.OptionalBool(true) errPolicy := &policy.Policy{ ErrorHandlingPolicy: policy.ErrorHandlingPolicy{ IgnoreFileErrors: &trueVal, IgnoreDirectoryErrors: &trueVal, }, + UploadPolicy: policy.UploadPolicy{ + MaxParallelFileReads: ¶llelism, + }, } policyTree, err := policy.TreeForSourceWithOverride(innerCtx, w.c, si, errPolicy) diff --git a/src/internal/m365/collection/drive/collection.go b/src/internal/m365/collection/drive/collection.go index 0c578d6ad..6fc274fbc 100644 --- a/src/internal/m365/collection/drive/collection.go +++ b/src/internal/m365/collection/drive/collection.go @@ -471,7 +471,7 @@ func (oc *Collection) streamItems(ctx context.Context, errs *fault.Bus) { int64(len(oc.driveItems))) defer close(folderProgress) - semaphoreCh := make(chan struct{}, graph.Parallelism(path.OneDriveService).Item()) + semaphoreCh := make(chan struct{}, 8) defer close(semaphoreCh) ctx = clues.Add(ctx,