From a9d979e4d789b27307fbf8a215049e18f578cca6 Mon Sep 17 00:00:00 2001 From: Vitalii Date: Fri, 7 Jul 2023 13:57:44 +0300 Subject: [PATCH] web/satellite: update default multipart upload part size Updated multipart upload part size to be 64MB or higher depending on file size. Increased queue size from 4 to 5 (5 parts being uploaded at a time) because theoretically it can decrease uploading time, right? Issue: https://github.com/storj/storj/issues/5851 Change-Id: Ida5661fa0ed6bc5a0651afc05b5feb7e77791efe --- web/satellite/src/store/modules/objectBrowserStore.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/web/satellite/src/store/modules/objectBrowserStore.ts b/web/satellite/src/store/modules/objectBrowserStore.ts index 29ef357db..be912800f 100644 --- a/web/satellite/src/store/modules/objectBrowserStore.ts +++ b/web/satellite/src/store/modules/objectBrowserStore.ts @@ -464,9 +464,15 @@ export const useObjectBrowserStore = defineStore('objectBrowser', () => { appStore.setLargeUploadWarningNotification(true); } + // Upload 5 parts at a time. + const queueSize = 5; + // Part size must be 64MB or higher, depending on file size. + const partSize = Math.max(64 * 1024 * 1024, Math.floor(body.size / queueSize)); + const upload = new Upload({ client: state.s3, - partSize: 64 * 1024 * 1024, + queueSize, + partSize, params, });