Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support unknown content-length for put #285

Merged
merged 60 commits into from
May 22, 2023
Merged

Support unknown content-length for put #285

merged 60 commits into from
May 22, 2023

Conversation

DmitriyMusatkin
Copy link
Contributor

Issue #, if available:

Description of changes:
Support unknown content length for put

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@codecov-commenter
Copy link

codecov-commenter commented May 10, 2023

Codecov Report

Merging #285 (cacdf06) into main (6203b23) will increase coverage by 0.14%.
The diff coverage is 96.12%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #285      +/-   ##
==========================================
+ Coverage   88.13%   88.28%   +0.14%     
==========================================
  Files          16       16              
  Lines        4341     4412      +71     
==========================================
+ Hits         3826     3895      +69     
- Misses        515      517       +2     
Impacted Files Coverage Δ
source/s3.c 96.15% <ø> (ø)
source/s3_auto_ranged_get.c 98.86% <ø> (-0.39%) ⬇️
source/s3_checksums.c 92.00% <ø> (ø)
source/s3_default_meta_request.c 93.13% <ø> (ø)
source/s3_endpoint.c 90.44% <ø> (ø)
source/s3_client.c 87.78% <82.35%> (+0.04%) ⬆️
source/s3_auto_ranged_put.c 92.65% <97.56%> (+0.69%) ⬆️
source/s3_meta_request.c 94.56% <100.00%> (+0.04%) ⬆️
source/s3_request_messages.c 63.48% <100.00%> (+0.17%) ⬆️
source/s3_util.c 98.73% <100.00%> (ø)

include/aws/s3/s3_client.h Outdated Show resolved Hide resolved
source/s3_auto_ranged_put.c Outdated Show resolved Hide resolved
source/s3_auto_ranged_put.c Outdated Show resolved Hide resolved
source/s3_auto_ranged_put.c Outdated Show resolved Hide resolved
source/s3_auto_ranged_put.c Outdated Show resolved Hide resolved
source/s3_auto_ranged_put.c Show resolved Hide resolved
source/s3_auto_ranged_put.c Outdated Show resolved Hide resolved
source/s3_client.c Show resolved Hide resolved
source/s3_auto_ranged_put.c Outdated Show resolved Hide resolved
Comment on lines +109 to +110
add_net_test_case(test_s3_put_object_no_content_length)
add_net_test_case(test_s3_put_object_single_part_no_content_length)
Copy link
Contributor

Choose a reason for hiding this comment

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

make sure we have tests that:

  • create a 0-size Object
  • create a noop part, after creating 1+ normal parts

Copy link
Contributor Author

Choose a reason for hiding this comment

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

test for 0 size object added. it uncovered some issues that were fixed.
existing tests already hit path for noop part, due to tests having at most 3 parts and optimistic scheduling was set at min of 5

source/s3.c Outdated Show resolved Hide resolved
source/s3_auto_ranged_put.c Outdated Show resolved Hide resolved
source/s3_auto_ranged_put.c Outdated Show resolved Hide resolved
source/s3_auto_ranged_put.c Outdated Show resolved Hide resolved
source/s3.c Outdated Show resolved Hide resolved
source/s3_client.c Outdated Show resolved Hide resolved
Copy link
Contributor

@graebm graebm left a comment

Choose a reason for hiding this comment

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

Fix & Shipit

DmitriyMusatkin and others added 2 commits May 22, 2023 13:36
Co-authored-by: Michael Graeb <graebm@amazon.com>
@DmitriyMusatkin DmitriyMusatkin merged commit 25b0643 into main May 22, 2023
@DmitriyMusatkin DmitriyMusatkin deleted the content-len branch May 22, 2023 21:58
@djchapm
Copy link

djchapm commented Jun 15, 2023

Hey - been waiting a long time for something like this - thanks for implementing. But experiencing performance problem - can you tell me what happens between the time I complete my request, and the AsyncUpload actually completes? I'm using AWS SDK V2 S3 API to do Async upload with CRT Async Client - works without specifying upload size now due to this update, just there's a huge lag once I'm done. Not sure where to go with this or who to ask. Ends up being much slower start to finish than our old workaround for unknown content size. Thanks!

@graebm
Copy link
Contributor

graebm commented Jun 16, 2023

Please create an issue. This pull-request is a weird place to have a long debugging conversation

Please explain your workload:

  • approximate size of objects you're uploading
  • EC2 instance type
  • what did you set target throughput to?
  • did you customize part size?
  • where is the data coming from? is it coming fast or slow? is it coming in a smooth stream, or coming in bursts from some other source?

@graebm
Copy link
Contributor

graebm commented Jun 16, 2023

But to explain what's going on under the hood...

since we don't know how much data will be sent, we assume it will be large and treat it as a Multipart Upload. We send CreateMultipartUpload, then send an UploadPart for each 8MiB of data, then send CompleteMultipartUpload when it's done. If you're sending files smaller than 8MiB lower performance is expected (if we knew the length in advance, we'd just send 1 PutObject). We have ideas on how to optimize this, but it adds a lot of complexity. It's something we hope to tackle in the future.

@TingDaoK
Copy link
Contributor

If it's the lag after the send has ended, I would check the integration between how you create the input and how it's passed from Java to C. As in C, we check the input_stream status to complete the MPU.

@djchapm
Copy link

djchapm commented Jun 16, 2023

Thanks for the quick response - will create an issue and if you think it's unrelated to aws-c-s3 then we can ship it to s3-transfer-manager.

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.

6 participants