Skip to content

Support for concurrent S3 part uploads - #2510

Open
barnabehvrd wants to merge 3 commits into
pelican:mainfrom
barnabehvrd:concurent-s3-parts-upload
Open

Support for concurrent S3 part uploads#2510
barnabehvrd wants to merge 3 commits into
pelican:mainfrom
barnabehvrd:concurent-s3-parts-upload

Conversation

@barnabehvrd

@barnabehvrd barnabehvrd commented Aug 11, 2026

Copy link
Copy Markdown

Currently, when uploading an S3 backup, wings can only upload one part at the time.

Following PR #2504 / issue #2491, S3 backups have been made more reliable and the network overhead has been reduced.

However, a single TCP connection is limited by congestion control (slow start, window scaling) and rarely saturates a fast link on its own.

S3 supports concurrent uploads. This allows for faster uploads by making full use of the available bandwidth.

This PR simply aims to:

  1. Create a BACKUP_MAX_CONCURRENT_UPLOADS parameter, set to 10 by default
  2. Allow a custom value for this parameter to be set in the .env file
  3. Inform Wings of the user’s choice when creating an S3 backup

The default of 10 is based on benchmarks in the Wings PR: most of the throughput gain is already reached at moderate concurrency, and 10 scales well to large backups (hundreds of parts) while keeping connection pressure on the S3 endpoint reasonable.
If Wings receives no value or an invalid one (e.g. from an older Panel), it falls back to sequential uploads.

The new S3 asynchronous multipart upload logic is located in Wings, in PR pelican/wings#205

@github-actions

github-actions Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The change adds a default and environment override for backup upload concurrency. getUploadParts returns the resolved value as max_concurrent_uploads in the upload metadata.

Changes

Backup upload concurrency

Layer / File(s) Summary
Define concurrency setting
app/Http/Controllers/Api/Remote/Backups/BackupRemoteUploadController.php, config/backups.php
The controller defines a default of 10. Backup configuration supports BACKUP_MAX_CONCURRENT_UPLOADS and documents the setting.
Expose concurrency in upload metadata
app/Extensions/BackupAdapter/Schemas/S3BackupSchema.php
getUploadParts resolves the configured value and returns it as max_concurrent_uploads.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly summarizes the main change: support for concurrent S3 part uploads.
Description check ✅ Passed The description directly explains the new configuration, default value, override behavior, and transfer of the setting to Wings.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
app/Extensions/BackupAdapter/Schemas/S3BackupSchema.php (1)

149-152: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick win

Update the getUploadParts return shape.

The @return annotation at Line 103 declares only parts and part_size, but the method now returns max_concurrent_uploads. Update the annotation so static analysis and callers see the complete response contract.

Proposed annotation update
-    /** `@return` array{parts: string[], part_size: int} */
+    /** `@return` array{parts: string[], part_size: int, max_concurrent_uploads: int} */
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@app/Extensions/BackupAdapter/Schemas/S3BackupSchema.php` around lines 149 -
152, Update the `@return` annotation for getUploadParts to include the
max_concurrent_uploads field alongside parts and part_size, matching the
complete array returned by the method.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@app/Extensions/BackupAdapter/Schemas/S3BackupSchema.php`:
- Around line 144-152: Validate $maxConcurrentUploads in the S3 backup schema
before returning it, treating zero, negative values, and non-numeric
configuration values as invalid and falling back to
BackupRemoteUploadController::MAX_CONCURRENT_UPLOADS; also update the PHPDoc
return shape to declare max_concurrent_uploads.

---

Nitpick comments:
In `@app/Extensions/BackupAdapter/Schemas/S3BackupSchema.php`:
- Around line 149-152: Update the `@return` annotation for getUploadParts to
include the max_concurrent_uploads field alongside parts and part_size, matching
the complete array returned by the method.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 248a4778-cd96-4cec-8e8c-c6f986a472d6

📥 Commits

Reviewing files that changed from the base of the PR and between 3bd26df and 5cb8ea3.

📒 Files selected for processing (3)
  • app/Extensions/BackupAdapter/Schemas/S3BackupSchema.php
  • app/Http/Controllers/Api/Remote/Backups/BackupRemoteUploadController.php
  • config/backups.php

Comment thread app/Extensions/BackupAdapter/Schemas/S3BackupSchema.php
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant