Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

`rc mirror` Upload Performance

Offen
#385 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
78/100
Issue-Typ
Feature
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
rust
Bereich
cli, performance

Rechercherichtung

Start in crates/s3/src/client.rs around lines 4300-4312, then inspect the single-part and multipart upload paths and their handling of ObjectWritePrecondition. Use the reported nested-folder benchmark as the validation baseline. Done means small preconditioned files avoid unnecessary multipart requests while If-None-Match and If-Match behavior remains correct.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

I recently compared the upload performance of rc mirror vs MinIO's mc mirror against a RustFS server.

Generally, rc mirror turned out to be about six times slower than mc mirror on my machine. I did some investigation and found two major causes for this:

  1. mc mirror seems to use stronger parallelization per default
  2. Small files get uploaded by mc mirror as single PutObject operations, whereas rc mirror always uses a multipart upload.

Point 2 means that for small files, rc mirror makes three requests instead of one, and accordingly triples the upload time. In the code (crates/s3/src/client.rs line 4300-4312, I found a reason for that, namely

// RustFS evaluates write preconditions for multipart completion. Keep
// ordinary small uploads on PutObject, but route conditional path writes
// through multipart so mirror retains compare-and-swap semantics on the
// currently deployed service.
if Self::should_use_multipart(file_size)
    || !matches!(precondition, ObjectWritePrecondition::None)
{
    self.put_object_multipart_from_path(path, file_path, file_size, options, on_progress)
        .await
} else {
    self.put_object_single_part_from_path(path, file_path, file_size, options)
        .await
}

So I understand that's a safeguard to ensure write preconditions are respected. However, since version 1.0.0-alpha.47 (rustfs/rustfs#409), RustFS also enforces If-None-Match/If-Match write preconditions on PutObject itself.
I would therefore suggest to drop the multipart upload route for small files with preconditions. I have already tested it (approx. 25k files in a nested folder structure, with average file size of ~25 KB), and it expectedly increases upload performance by roughly a factor of three for small files (still significantly slower than mc, though):

Command Number of runs Average real time Average user time Average sys time
mc mirror 10 25.120s 9.295s 9.815s
rc mirror 10 168.318s 12.236s 16.648s
rc mirror (skip multipart for small files) 10 42.561s 6.254s 9.561s

Are there any objections against this change? If not, I'd be happy to set up a PR.

Vorherrschende Sprache
Rust
Sterne
159
Forks
23
Ø Merge
7 Std. 4 Min.
Gemergte PRs (30 T.)
10

Entwicklungsumgebung

  • Enthält ein Dockerfile oder eine Docker-Compose-Datei
  • Keine Pull-Request-Vorlage
  • Kein Beitragsleitfaden

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus rustfs/cli

Alle Issues in rustfs/cli

Ähnliche Issues

Weitere Issues zu Rust

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.