Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

`rc mirror` Upload Performance

Đang mở
#385 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
78/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
rust
Lĩnh vực
cli, performance

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Rust
Star
159
Fork
23
Merge trung bình
7 giờ 4 phút
Pull request đã merge (30 ngày)
10

Chuẩn bị môi trường

  • Có Dockerfile hoặc tệp Docker Compose
  • Không có mẫu pull request
  • Không có hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của rustfs/cli

Tất cả issue của rustfs/cli

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.