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

Disable read-backpressure in the crt-c runner #70

Merged
merged 1 commit into from
Aug 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions runners/s3-benchrunner-c/CRunner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,20 @@

using namespace std;

// 256MiB is Java Transfer Mgr V2's default
// TODO: Investigate. At time of writing, this noticeably impacts performance.
#define BACKPRESSURE_INITIAL_READ_WINDOW_MiB 256
// Read-backpressure (feature added Sept 2022) can prevent running out of
// memory due to downloading data faster than we can write it to disk.
// 256MiB is Java Transfer Mgr V2's default initial window (as of Aug 2024).
// Unfortunately, this hurts the performance of single-file workloads
// due to limiting the number of parts in-flight for a given file.
// But the effect goes away if there are lots of files in a workload,
// because the total number of parts in-flight gets high enough.
//
// The memory-limiter (feature added 1 yr later in Nov 2023) is another way
// to prevent running out of memory.
//
// This benchmark can turn off backpressure and rely solely on the memory-limiter,
// since it always processes data synchronously within the body callback.
// #define BACKPRESSURE_INITIAL_READ_WINDOW_MiB 256 /* If commented out, backpressure is disabled */

aws_byte_cursor toCursor(string_view src)
{
Expand Down Expand Up @@ -178,6 +189,7 @@ CRunner::CRunner(const BenchmarkConfig &config) : BenchmarkRunner(config)
s3ClientConfig.enable_s3express = true;
}

#if defined(BACKPRESSURE_INITIAL_READ_WINDOW_MiB)
// If writing data to disk, enable backpressure.
// This prevents us from running out of memory due to downloading
// data faster than we can write it to disk.
Expand All @@ -186,6 +198,7 @@ CRunner::CRunner(const BenchmarkConfig &config) : BenchmarkRunner(config)
s3ClientConfig.enable_read_backpressure = true;
s3ClientConfig.initial_read_window = bytesFromMiB(BACKPRESSURE_INITIAL_READ_WINDOW_MiB);
}
#endif

// struct aws_http_connection_monitoring_options httpMonitoringOpts;
// AWS_ZERO_STRUCT(httpMonitoringOpts);
Expand Down
Loading