fix(storage): bound the upload part size so uploads don't OOM the registry #44

Merged
sharang merged 1 commits from fix/upload-part-size into main 2026-09-28 09:21:08 +00:00
Owner

Bug

In the staging acceptance run, test S3 (upload a document in /admin) failed with "This page couldn't load". After that, /admin showed only "fetch failed": orca-tenant-registry-stage had been OOM-killed (exit 137, OOMKilled=true, limit 384 MiB) and did not restart.

Cause

The upload is streamed to S3 with size -1. With no configured part size, minio-go sizes a part for a 5 TiB object and allocates that buffer up front:

PartSize buffer per upload
unset 528 MiB
16 MiB 16 MiB

This happened on every upload, whatever the file size.

Fix

PutObjectOptions.PartSize = 16 MiB, one part at a time. 10,000 parts still allow 160 GB, far above the 200 MB limit. A test guards the options.

🤖 Generated with Claude Code

https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB

## Bug In the staging acceptance run, test S3 (upload a document in `/admin`) failed with "This page couldn't load". After that, `/admin` showed only "fetch failed": `orca-tenant-registry-stage` had been OOM-killed (exit 137, `OOMKilled=true`, limit 384 MiB) and did not restart. ## Cause The upload is streamed to S3 with size `-1`. With no configured part size, minio-go sizes a part for a 5 TiB object and allocates that buffer up front: | PartSize | buffer per upload | |---|---| | unset | **528 MiB** | | 16 MiB | 16 MiB | This happened on every upload, whatever the file size. ## Fix `PutObjectOptions.PartSize = 16 MiB`, one part at a time. 10,000 parts still allow 160 GB, far above the 200 MB limit. A test guards the options. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB
sharang added 1 commit 2026-09-28 08:56:47 +00:00
fix(storage): bound the upload part size so uploads don't OOM the registry
ci / shared (pull_request) Successful in 14s
ci / test (pull_request) Successful in 23m40s
ci / image (pull_request) Skipped
5ce287f6e9
Uploads are streamed to S3 with an unknown size. minio-go then sizes one
part for the largest possible object (528 MiB) and allocates it up front,
which killed the registry at its 384 MiB limit on every upload (staging,
S3 test of the acceptance run). A fixed 16 MiB part caps the buffer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB
sharang merged commit b424e001dc into main 2026-09-28 09:21:08 +00:00
Sign in to join this conversation.