From 8b27353be78cf668ad3ddb0cccc85e995972a227 Mon Sep 17 00:00:00 2001 From: Luke Granger-Brown Date: Sun, 20 Oct 2024 17:23:36 +0100 Subject: [PATCH] fup: set buffer size to 8MiB SeaweedFS' default chunk size is 4MiB; if we don't match it (or a multiple) then our multipart uploads become uneven because they end up as chunks of the buffer size followed by the remaining data. This is particularly egregious with the current default of 5MiB, because then we get a 4MiB chunk followed by a 1MiB chunk every time. --- web/fup/fuphttp/metadata.go | 1 + 1 file changed, 1 insertion(+) diff --git a/web/fup/fuphttp/metadata.go b/web/fup/fuphttp/metadata.go index 60dec65395..095c77df99 100644 --- a/web/fup/fuphttp/metadata.go +++ b/web/fup/fuphttp/metadata.go @@ -40,6 +40,7 @@ func (m *Metadata) WriterOptions() *blob.WriterOptions { } return &blob.WriterOptions{ + BufferSize: 8 * 1024 * 1024, /* 8 MiB */ CacheControl: attrs.CacheControl, ContentDisposition: attrs.ContentDisposition, ContentEncoding: attrs.ContentEncoding,