Hiệu năng Amazon S3: multipart upload, Transfer Acceleration và prefix
Khi khối lượng dữ liệu và số người dùng tăng, tốc độ tải lên và khả năng chịu tải cao điểm trở thành vấn đề; S3 có các tính năng riêng cho từng tình huống.
Phần này trình bày bốn sự cố MFTECH gặp phải khi khối lượng dữ liệu và số lượng người dùng tăng lên, cùng chi phí của một lần tải lên qua Transfer Acceleration. Chạy từng tình huống, sau đó bật tính năng S3 tương ứng để so sánh kết quả:
Chọn tình huống và nhấn Chạy. Sau đó bật tính năng tương ứng và chạy lại để so sánh kết quả.
Transfer Acceleration tăng tốc cả hai chiều. Theo S3 FAQ, Transfer Acceleration tăng tốc truyền dữ liệu đường dài tới và từ một bucket (request tải lên và tải xuống cùng gửi tới endpoint <bucket>.s3-accelerate.amazonaws.com) và phát huy rõ nhất với object lớn. Khi MFTECH mở cổng cho các studio ở nhiều châu lục vừa tải lên vừa tải xuống video thô tới 10 GB, bật Transfer Acceleration trên bucket là cải thiện được cả hai chiều; không bắt buộc ghép thêm CloudFront. AWS khuyến nghị cân nhắc PUT/POST qua CloudFront khi object hoặc tập dữ liệu nhỏ hơn 1 GB; với tệp lớn hơn, Transfer Acceleration cho throughput cao hơn. CloudFront phù hợp khi cùng một nội dung được rất nhiều người xem lặp lại (ảnh, video quảng cáo), vì edge location cache nội dung đó.
- Tệp dung lượng lớn: multipart upload (bắt buộc với object trên 5 GB).
- Truyền tệp lớn (từ khoảng 1 GB) qua khoảng cách xa tới hoặc từ một bucket: Transfer Acceleration, tăng tốc cả tải lên lẫn tải xuống (đi qua edge location của CloudFront; có thể phát sinh phí truyền dữ liệu bổ sung); tệp nhỏ hơn 1 GB: cân nhắc PUT/POST qua CloudFront.
- Số lượng request quá lớn: phân bổ key ra nhiều prefix.
- Chỉ cần một phần của tệp: byte-range fetch (header
Rangetrong request GET). - Chi phí: data transfer in từ Internet vào S3 miễn phí; phí Transfer Acceleration cộng thêm vào phí data transfer và chỉ tính cho lần truyền được tăng tốc.
- S3 Select (truy vấn SQL trên nội dung một object CSV, JSON hoặc Parquet) không còn nhận khách hàng mới.
Amazon S3 performance: multipart upload, Transfer Acceleration and prefixes
As data and users grow, upload speed and peak-time load become problems; S3 has a specific feature for each situation.
This part presents four problems MFTECH ran into as data volume and the number of users grew, plus the cost of one upload through Transfer Acceleration. Run each scenario, then turn on the matching S3 feature to compare the results:
Chọn tình huống và nhấn Chạy. Sau đó bật tính năng tương ứng và chạy lại để so sánh kết quả.
Transfer Acceleration speeds up both directions. According to the S3 FAQs, Transfer Acceleration speeds up long-distance transfers to and from a single bucket (uploads and downloads both go to the <bucket>.s3-accelerate.amazonaws.com endpoint) and helps most with larger objects. When MFTECH opens a portal where studios on several continents both upload and download raw videos of up to 10 GB, enabling Transfer Acceleration on the bucket improves both directions; adding CloudFront is not required. AWS suggests considering CloudFront’s PUT/POST when objects or the data set are smaller than 1 GB; for larger files, Transfer Acceleration gives higher throughput. CloudFront fits when the same content is viewed repeatedly by many people (images, promotional videos), because edge locations cache that content.
- Large files: multipart upload (required for objects over 5 GB).
- Large files (about 1 GB and up) moved over long distances to or from one bucket: Transfer Acceleration, which speeds up both uploads and downloads (goes through CloudFront edge locations; can incur additional data transfer charges); files under 1 GB: consider CloudFront PUT/POST.
- Too many requests: spread keys across many prefixes.
- Only part of a file is needed: byte-range fetch (a
Rangeheader on a GET request). - Cost: data transfer in from the internet to S3 is free; the Transfer Acceleration charge is in addition to data transfer pricing and applies only to transfers that are accelerated.
- S3 Select (SQL queries on the content of one CSV, JSON or Parquet object) is no longer available to new customers.