Skip to content

Commit 7fef54c

Browse files
author
Krish
committed
add a scaling factor
1 parent 55f2245 commit 7fef54c

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

source/s3_meta_request.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,11 @@ static void s_validate_meta_request_checksum_on_finish(
164164
* Currently calculates based on: target_throughput / throughput_per_connection
165165
* Uses different throughput constants for S3 vs S3 Express.
166166
* TODO: Consider payload size, number of parts, and part size for more accurate calculation.
167+
* As part of this, this is the preliminary iteration where we take into account, the number of parts and part size.
168+
* The distribution of connections uses something called a weight, a ratio of part_number / part_size.
169+
* we can use the same weight while providing the connections to provide more connections to the same sized object if
170+
* the number of parts is higher.
171+
* As part of experiments, we have identified that
167172
*/
168173
uint32_t s_calculate_meta_request_connections(struct aws_s3_client *client, struct aws_s3_meta_request *meta_request) {
169174
AWS_PRECONDITION(client);
@@ -173,8 +178,10 @@ uint32_t s_calculate_meta_request_connections(struct aws_s3_client *client, stru
173178
double throughput_per_connection =
174179
meta_request->is_express ? g_s3express_throughput_per_connection_gbps : g_s3_throughput_per_connection_gbps;
175180

181+
double achieved_weight = 145.50 / (30 * 1024 * 1024 * 1024);
176182
/* Calculate connections needed: target_throughput / throughput_per_connection */
177-
double ideal_connections = client->throughput_target_gbps / throughput_per_connection;
183+
double ideal_connections =
184+
(client->throughput_target_gbps * meta_request->weight) / (achieved_weight * throughput_per_connection);
178185
uint32_t required_connections = (uint32_t)ceil(ideal_connections);
179186

180187
/* Clamp to reasonable range */

0 commit comments

Comments
 (0)