From 7f3b2be1e8d855f64742a0c3fdf8417c66ac8f8e Mon Sep 17 00:00:00 2001 From: Michael Eischer Date: Wed, 13 Jul 2022 18:00:17 +0200 Subject: [PATCH] s3: Disable multipart uploads below 200MB --- internal/backend/s3/s3.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/backend/s3/s3.go b/internal/backend/s3/s3.go index 85c82161c..0b3816c06 100644 --- a/internal/backend/s3/s3.go +++ b/internal/backend/s3/s3.go @@ -291,6 +291,8 @@ func (be *Backend) Save(ctx context.Context, h restic.Handle, rd restic.RewindRe opts.ContentType = "application/octet-stream" // the only option with the high-level api is to let the library handle the checksum computation opts.SendContentMd5 = true + // only use multipart uploads for very large files + opts.PartSize = 200 * 1024 * 1024 debug.Log("PutObject(%v, %v, %v)", be.cfg.Bucket, objName, rd.Length()) info, err := be.client.PutObject(ctx, be.cfg.Bucket, objName, ioutil.NopCloser(rd), int64(rd.Length()), opts)