Skip to content

http-client-benchmark with Apache SDK client added #6256

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

Open
wants to merge 80 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
f3fc974
Add initial empty module for Apache5x for seting up package (#6075)
joviegas Apr 30, 2025
5092cc4
Baseline or Copy all the ApacheSDKHttpClient classes to newly added A…
joviegas May 6, 2025
6e9939f
Phase 2 , getting Apache 5 compilation and Junit ready along with cle…
joviegas May 22, 2025
4dda3f7
Merge branch 'master' into feature/master/apache5x
joviegas May 25, 2025
3053d09
Update the snap shot
joviegas May 25, 2025
985ca35
Fix HTTP authentication retry failures by improving RepeatableInputSt…
joviegas May 28, 2025
b97c9da
Merge branch 'master' into feature/master/apache5x
joviegas May 29, 2025
64f7d33
Updated snap shot after merge from master
joviegas May 29, 2025
24438e8
Revert "Updated snap shot after merge from master"
joviegas May 29, 2025
62150d6
Updated snap shot after merge from master
joviegas May 29, 2025
fbfb70f
Fix architecture test failures for apache5.x (#6140)
joviegas May 29, 2025
3c4433c
Merge branch 'master' into feature/master/apache5x
joviegas May 30, 2025
6d8b5f4
Updated snap shot after merge from master
joviegas May 30, 2025
13c5796
Use reference of PoolingHttpClientConnectionManager instead of HttpCl…
joviegas Jun 2, 2025
0bdf878
Merge branch 'master' into feature/master/apache5x
joviegas Jun 2, 2025
265976d
Fix Apache5 HTTP client retry failures with non-resettable streams (#…
joviegas Jun 5, 2025
4671831
Merge branch 'master' into feature/master/apache5x
joviegas Jun 5, 2025
2f72282
Merge branch 'master' into feature/master/apache5x
joviegas Jun 17, 2025
79f6f0f
Merge PR#6165 https://github.com/aws/aws-sdk-java-v2/pull/6165
joviegas Jun 17, 2025
fcbc3c0
Disable Client based retries and define httpcore5 httpclient5 in .bra…
joviegas Jun 19, 2025
716a6db
Merge branch 'master' into feature/master/apache5x
joviegas Jun 21, 2025
09e8ee4
Update snapshots
joviegas Jun 21, 2025
ad30c25
Merge branch 'feature/master/apache5x' of github.com:aws/aws-sdk-java…
joviegas Jun 21, 2025
3cedfb1
Do not buffer the Response stream using BufferedHttpEntity (#6200)
joviegas Jun 24, 2025
959605c
Merge branch 'master' into feature/master/apache5x
joviegas Jun 24, 2025
a959581
Merge from master
joviegas Jun 24, 2025
e188995
Apache5x SDkBenhmark Tests (#6206)
joviegas Jun 26, 2025
3cc94bb
Clean up unused APIs and add test to make sure it can be handled with…
joviegas Jun 26, 2025
45f630d
Merge branch 'master' into feature/master/apache5x
joviegas Jun 26, 2025
67d6690
Upgrade Apache5 org.apache.httpcomponents.client5 to latest available…
joviegas Jun 26, 2025
c3cb46f
Preview API annotation added for Public APIs and TODOs addressed (#6215)
joviegas Jun 30, 2025
bb372da
Merge branch 'master' into feature/master/apache5x
joviegas Jun 30, 2025
d336053
Updated the snapshot
joviegas Jun 30, 2025
397f330
Updated thr Brazil package nma e to have preview as suffix
joviegas Jun 30, 2025
a21356a
Updated Version as -PREVIEW to release apache5 as preview release (#6…
joviegas Jul 1, 2025
1b1caa0
Handled Surface API review comments
joviegas Jul 1, 2025
8f086d7
Added a single test for localaddress , handled review comments
joviegas Jul 2, 2025
286b515
Removing internal package name as -preview after internal discussion
joviegas Jul 2, 2025
1b520dc
Fix transient text case failures
joviegas Jul 3, 2025
4aa1fdb
Handled Surface API review comments (#6224)
joviegas Jul 3, 2025
28a6b06
Merge branch 'feature/master/apache5x' into joviegas/post-surface-api…
joviegas Jul 7, 2025
198a814
Merge branch 'master' into feature/master/apache5x
joviegas Jul 7, 2025
661b152
update pom.xml for apache5.x
joviegas Jul 7, 2025
2d727fa
Merge branch 'feature/master/apache5x' into joviegas/post-surface-api…
joviegas Jul 7, 2025
3a51be0
Handled comment for merge to master PR for apache 5.x
joviegas Jul 8, 2025
251490c
Handled commed for merge to master PR 6220 (#6240)
joviegas Jul 8, 2025
7a7e4cd
Merge branch 'master' into feature/master/apache5x
joviegas Jul 10, 2025
6383c44
Added change logs
joviegas Jul 10, 2025
14ce677
Add Http client bench marks with S3 Get/Put
joviegas Jul 12, 2025
8e7ce75
Removed some dependencies
joviegas Jul 12, 2025
ee93292
Merge branch 'master' into feature/master/apache5x
joviegas Jul 14, 2025
5061901
updated performance comparison logic
joviegas Jul 14, 2025
4d88a3e
updated readme
joviegas Jul 14, 2025
0dd8786
Merge branch 'feature/master/apache5x' into joviegas/post-surface-api…
joviegas Jul 14, 2025
6dda6bd
updated warmup time and iterations
joviegas Jul 14, 2025
3f4ba25
remove performance comparison since we already have printed performam…
joviegas Jul 14, 2025
4833db9
Review from github
joviegas Jul 14, 2025
061b5fb
Review comment
joviegas Jul 14, 2025
59ac21f
updatded prints
joviegas Jul 14, 2025
f26f7bb
Handled Review comments
joviegas Jul 14, 2025
dfcfdcb
Merge branch 'master' into feature/master/apache5x
joviegas Jul 14, 2025
7d27844
Added performance comparison for Apache
joviegas Jul 14, 2025
305c62b
updated README
joviegas Jul 14, 2025
1acd510
remove preview buid
joviegas Jul 15, 2025
5d78ede
Merge branch 'feature/master/apache5x' into joviegas/post-surface-api…
joviegas Jul 15, 2025
807ad9f
added changed to skpi http client benchmark
joviegas Jul 15, 2025
d382185
updated the snapshot version
joviegas Jul 15, 2025
78ac2e2
updated to run on jdk8
joviegas Jul 15, 2025
9d1255b
merge from master
joviegas Jul 15, 2025
422d197
merge from master
joviegas Jul 15, 2025
832b52c
updated README.md
joviegas Jul 15, 2025
29ab8d9
fixed checkbuild issues
joviegas Jul 15, 2025
99e697e
fixed checksyle issues
joviegas Jul 16, 2025
b536571
fixed issue where secondary benchmarks were not found
joviegas Jul 16, 2025
1d2a5b5
Revert "fixed issue where secondary benchmarks were not found"
joviegas Jul 16, 2025
c7dff89
Revert "fixed checksyle issues"
joviegas Jul 16, 2025
ad00477
Fixed checkstyle issues
joviegas Jul 16, 2025
12b37f4
Handled review comments
joviegas Jul 17, 2025
53565ac
Merge branch 'master' into joviegas/post-surface-api-review
joviegas Jul 18, 2025
1887fac
Updated snapshot
joviegas Jul 19, 2025
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
1 change: 1 addition & 0 deletions .brazil.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
"region-testing": { "skipImport": true },
"release-scripts": { "skipImport": true },
"s3-benchmarks": { "skipImport": true },
"http-client-benchmarks": { "skipImport": true },
"sdk-benchmarks": { "skipImport": true },
"sdk-native-image-test": { "skipImport": true },
"service-test-utils": { "skipImport": true },
Expand Down
2 changes: 1 addition & 1 deletion buildspecs/release-javadoc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ phases:
pre_build:
commands:
- DOC_PATH='s3://aws-java-sdk-javadoc/java/api'
- MODULES_TO_SKIP="protocol-tests,protocol-tests-core,codegen-generated-classes-test,sdk-benchmarks,s3-benchmarks,module-path-tests,test-utils,http-client-tests,tests-coverage-reporting,sdk-native-image-test,ruleset-testing-core,old-client-version-compatibility-test,crt-unavailable-tests,bundle-shading-tests,v2-migration,v2-migration-tests,architecture-tests,s3-tests"
- MODULES_TO_SKIP="protocol-tests,protocol-tests-core,codegen-generated-classes-test,sdk-benchmarks,s3-benchmarks,http-client-benchmarks,module-path-tests,test-utils,http-client-tests,tests-coverage-reporting,sdk-native-image-test,ruleset-testing-core,old-client-version-compatibility-test,crt-unavailable-tests,bundle-shading-tests,v2-migration,v2-migration-tests,architecture-tests,s3-tests"

build:
commands:
Expand Down
2 changes: 1 addition & 1 deletion buildspecs/release-to-maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ phases:
- SDK_SIGNING_GPG_PASSPHRASE_ARN="arn:aws:secretsmanager:us-east-1:103431983078:secret:sdk-signing-gpg-passphrase-A0H1Kq"
- SONATYPE_PASSWORD_ARN="arn:aws:secretsmanager:us-east-1:103431983078:secret:sonatype-password-I2V6Y0"
- SONATYPE_USERNAME_ARN="arn:aws:secretsmanager:us-east-1:103431983078:secret:sonatype-username-HphNZQ"
- MODULES_TO_SKIP="protocol-tests,protocol-tests-core,codegen-generated-classes-test,sdk-benchmarks,module-path-tests,tests-coverage-reporting,stability-tests,sdk-native-image-test,auth-tests,s3-benchmarks,region-testing,old-client-version-compatibility-test,crt-unavailable-tests,bundle-shading-tests,v2-migration-tests,architecture-tests,s3-tests"
- MODULES_TO_SKIP="protocol-tests,protocol-tests-core,codegen-generated-classes-test,sdk-benchmarks,module-path-tests,tests-coverage-reporting,stability-tests,sdk-native-image-test,auth-tests,s3-benchmarks,http-client-benchmarks,region-testing,old-client-version-compatibility-test,crt-unavailable-tests,bundle-shading-tests,v2-migration-tests,architecture-tests,s3-tests"

build:
commands:
Expand Down
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
<module>test/test-utils</module>
<module>test/codegen-generated-classes-test</module>
<module>test/sdk-benchmarks</module>
<module>test/http-client-benchmarks</module>
<module>test/module-path-tests</module>
<module>test/tests-coverage-reporting</module>
<module>test/stability-tests</module>
Expand Down
2 changes: 1 addition & 1 deletion scripts/validate-brazil-config
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import re
# Usage: validate-brazil-config [module-paths-file] [dependencies-file]

# Generating module-paths-file:
# mvn exec:exec -Dexec.executable=pwd -pl \!:aws-sdk-java-pom,\!:sdk-benchmarks,\!:module-path-tests -q 2>&1 > modules.txt
# mvn exec:exec -Dexec.executable=pwd -pl \!:aws-sdk-java-pom,\!:sdk-benchmarks,\!:http-client-benchmarks,\!:module-path-tests -q 2>&1 > modules.txt
#
# Generates contents similar to:
# /workspace/aws-sdk-java-v2/build-tools
Expand Down
61 changes: 61 additions & 0 deletions test/http-client-benchmarks/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# HTTP Client Benchmark Harness

This module contains HTTP client benchmark harness using [JMH].

Each benchmark class has a set of default
JMH configurations tailored to HTTP client performance testing and you might need to
adjust them based on your test environment such as increasing warmup iterations
or measurement time in order to get more reliable data.

There are three ways to run benchmarks.

- Using the executable JAR (Preferred usage per JMH site)
```
mvn clean install -P quick -pl :http-client-benchmarks --am
```

# Run specific benchmark
```
java -jar target/http-client-benchmarks.jar Apache5Benchmark
```

# Run all benchmarks: 3 warm up iterations, 3 benchmark iterations, 1 fork.
```
java -jar target/http-client-benchmarks.jar -wi 3 -i 3 -f 1
```

- Using `mvn exec:exec` commands to invoke `UnifiedBenchmarkRunner` main method
```
mvn clean install -P quick -pl :http-client-benchmarks --am
mvn clean install -pl :bom-internal
cd test/http-client-benchmarks
mvn exec:exec
```

## UnifiedBenchmarkRunner

The `UnifiedBenchmarkRunner` provides a comprehensive comparison between different HTTP client implementations:

- **Apache4**: Apache HttpClient 4.x baseline
- **Apache5-Platform**: Apache HttpClient 5.x with platform threads
- **Apache5-Virtual**: Apache HttpClient 5.x with virtual threads

The runner executes all benchmark variations, prints metrics to console, and publishes results to CloudWatch metrics for monitoring and analysis.

## Benchmark Operations

Each benchmark implementation tests the following operations:
- `simpleGet`: Single-threaded GET operations
- `simplePut`: Single-threaded PUT operations
- `multiThreadedGet`: Multi-threaded GET operations (10 threads)
- `multiThreadedPut`: Multi-threaded PUT operations (10 threads)

## Prerequisites

### Java Runtime Requirements

- **Java 8+**: Required for running the benchmarks (as specified by `<javac.target>8</javac.target>`)
- **Java 21+**: Required for virtual threads support (Apache5-Virtual benchmarks)

**Note**: Virtual threads are a preview feature in Java 19-20 and became stable in Java 21. The Apache5-Virtual benchmarks require Java 21 or later.

262 changes: 262 additions & 0 deletions test/http-client-benchmarks/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,262 @@
<!--
~ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
~
~ Licensed under the Apache License, Version 2.0 (the "License").
~ You may not use this file except in compliance with the License.
~ A copy of the License is located at
~
~ http://aws.amazon.com/apache2.0
~
~ or in the "license" file accompanying this file. This file is distributed
~ on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
~ express or implied. See the License for the specific language governing
~ permissions and limitations under the License.
-->

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>software.amazon.awssdk</groupId>
<artifactId>aws-sdk-java-pom</artifactId>
<version>2.32.5-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

<artifactId>http-client-benchmarks</artifactId>
<packaging>jar</packaging>

<name>AWS Java SDK :: Test :: HTTP CLIENT Benchmarks</name>
<description>Contains JMH benchmark code for the SDK HTTP CLIENTS</description>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jmh.version>1.37</jmh.version>
<javac.target>1.8</javac.target>
<uberjar.name>http-client-benchmarks</uberjar.name>
<exec-maven-plugin.version>1.6.0</exec-maven-plugin.version>
</properties>


<dependencies>
<dependency>
<groupId>org.openjdk.jmh</groupId>
<artifactId>jmh-core</artifactId>
<version>${jmh.version}</version>
</dependency>
<dependency>
<groupId>org.openjdk.jmh</groupId>
<artifactId>jmh-generator-annprocess</artifactId>
<version>${jmh.version}</version>
<scope>provided</scope>
</dependency>

<!-- AWS SDK Dependencies -->
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>s3</artifactId>
<version>${awsjavasdk.version}</version>
</dependency>
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>cloudwatch</artifactId>
<version>${awsjavasdk.version}</version>
</dependency>

<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>apache-client</artifactId>
<version>${awsjavasdk.version}</version>
</dependency>
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>apache5-client</artifactId>
<version>${awsjavasdk.version}-PREVIEW</version>
</dependency>

<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<scope>compile</scope>
</dependency>
</dependencies>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>bom-internal</artifactId>
<version>${awsjavasdk.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

<build>
<resources>
<resource>
<directory>src/main/resources</directory>
</resource>
</resources>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<!-- Override the configuration in the parent-->
<configuration combine.self="override">
<compilerVersion>${javac.target}</compilerVersion>
<source>${javac.target}</source>
<target>${javac.target}</target>
</configuration>
<executions>
<execution>
<id>compile</id>
<phase>none</phase>
</execution>
</executions>
<inherited>false</inherited>
</plugin>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>3.1.0</version>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.1</version>
</plugin>
<plugin>
<artifactId>maven-install-plugin</artifactId>
<version>2.5.1</version>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
</plugin>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9.1</version>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>2.6</version>
</plugin>
<plugin>
<artifactId>maven-site-plugin</artifactId>
<version>3.3</version>
</plugin>
<plugin>
<artifactId>maven-source-plugin</artifactId>
<version>2.2.1</version>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.17</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.2</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<finalName>${uberjar.name}</finalName>
<createDependencyReducedPom>false</createDependencyReducedPom>
<artifactSet>
<includes>
<include>*:*</include>
</includes>
</artifactSet>
<transformers>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<manifestEntries>
<Main-Class>org.openjdk.jmh.Main</Main-Class>
</manifestEntries>
</transformer>
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
</transformers>
<filters>
<filter>
<!--
Shading signed JARs will fail without this.
http://stackoverflow.com/questions/999489/invalid-signature-file-when-attempting-to-run-a-jar
-->
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<!-- Need to use exec not java see:http://mail.openjdk.java.net/pipermail/jmh-dev/2014-July/001192.html, https://stackoverflow.com/questions/15013651/using-maven-execexec-with-arguments -->
<artifactId>exec-maven-plugin</artifactId>
<version>${exec-maven-plugin.version}</version>
<configuration>
<executable>java</executable>
<arguments>
<argument>-classpath</argument>
<classpath/>
<argument>software.amazon.awssdk.benchmark.UnifiedBenchmarkRunner</argument>
<!-- Fail process on failed benchmarks -->
<argument>-c</argument>
</arguments>
</configuration>
</plugin>
<plugin>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-maven-plugin</artifactId>
<configuration>
<!-- Skipping spotbugs for the generated JMH classes-->
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>analyze-only</goal>
</goals>
</execution>
</executions>
<configuration>
<!-- Skipping maven dependencies analysis to speed up the build -->
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>

</project>
Loading
Loading