Skip to content

Commit 52e4e21

Browse files
committed
Address offline feedback
Signed-off-by: Alessandro Passaro <[email protected]>
1 parent d1db289 commit 52e4e21

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

mountpoint-s3-fs/examples/prefetch_benchmark.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ fn parse_duration(arg: &str) -> Result<Duration, String> {
125125
}
126126

127127
impl CliArgs {
128-
fn memory_target(&self) -> u64 {
128+
fn memory_target_in_bytes(&self) -> u64 {
129129
if let Some(target) = self.max_memory_target {
130130
target * 1024 * 1024
131131
} else {
@@ -136,10 +136,10 @@ impl CliArgs {
136136
}
137137

138138
fn s3_client_config(&self) -> S3ClientConfig {
139-
let initial_read_window_size = 1024 * 1024 + 128 * 1024;
139+
// Set up backpressure with the same initial window used in Mountpoint.
140140
let mut client_config = S3ClientConfig::new()
141141
.read_backpressure(true)
142-
.initial_read_window(initial_read_window_size)
142+
.initial_read_window(mountpoint_s3_fs::s3::config::INITIAL_READ_WINDOW_SIZE)
143143
.endpoint_config(EndpointConfig::new(self.region.as_str()));
144144
if let Some(throughput_target_gbps) = self.maximum_throughput_gbps {
145145
client_config = client_config.throughput_target_gbps(throughput_target_gbps as f64);
@@ -166,7 +166,7 @@ fn main() -> anyhow::Result<()> {
166166
let bucket = args.bucket.as_str();
167167
let client_config = args.s3_client_config();
168168
let client = S3CrtClient::new(client_config).context("failed to create S3 CRT client")?;
169-
let mem_limiter = Arc::new(MemoryLimiter::new(client.clone(), args.memory_target()));
169+
let mem_limiter = Arc::new(MemoryLimiter::new(client.clone(), args.memory_target_in_bytes()));
170170
let runtime = Runtime::new(client.event_loop_group());
171171

172172
// Verify if all objects exist and collect metadata

mountpoint-s3-fs/src/s3/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ impl TargetThroughputSetting {
269269
//
270270
// Note the CRT does not respect this value right now, they always return chunks of part size
271271
// but this is the first window size we prefer.
272-
const INITIAL_READ_WINDOW_SIZE: usize = 1024 * 1024 + 128 * 1024;
272+
pub const INITIAL_READ_WINDOW_SIZE: usize = 1024 * 1024 + 128 * 1024;
273273

274274
impl ClientConfig {
275275
/// Create an [S3CrtClient]

0 commit comments

Comments
 (0)