diff --git a/benchmarks/README.md b/benchmarks/README.md index f66606627..16aa251ca 100644 --- a/benchmarks/README.md +++ b/benchmarks/README.md @@ -7,5 +7,5 @@ The benchmarks do not measure the performance of target JDBC drivers nor the per ## Usage 1. Build the benchmarks with the following command `../gradlew jmhJar`. 1. the JAR file will be outputted to `build/libs` -2. Run the benchmarks with the following command `java -jar build/libs/benchmarks-1.0.0-jmh.jar`. +2. Run the benchmarks with the following command `java -jar build/libs/benchmarks-1.0.1-jmh.jar`. 1. you may have to update the command based on the exact version of the produced JAR file diff --git a/benchmarks/src/jmh/java/software/amazon/jdbc/benchmarks/PluginBenchmarks.java b/benchmarks/src/jmh/java/software/amazon/jdbc/benchmarks/PluginBenchmarks.java index a84866540..7889f9e6d 100644 --- a/benchmarks/src/jmh/java/software/amazon/jdbc/benchmarks/PluginBenchmarks.java +++ b/benchmarks/src/jmh/java/software/amazon/jdbc/benchmarks/PluginBenchmarks.java @@ -113,9 +113,9 @@ public void initAndReleaseBaseLine() throws SQLException { } @Benchmark - public ConnectionWrapper initAndReleaseWithAllPlugins() throws SQLException { + public ConnectionWrapper initAndReleaseWithExecutionTimePlugin() throws SQLException { try (ConnectionWrapper wrapper = new ConnectionWrapper( - useAllPlugins(), + useExecutionTimePlugin(), CONNECTION_STRING, mockConnectionProvider)) { wrapper.releaseResources(); @@ -124,9 +124,9 @@ public ConnectionWrapper initAndReleaseWithAllPlugins() throws SQLException { } @Benchmark - public ConnectionWrapper initAndReleaseWithExecutionTimePlugin() throws SQLException { + public ConnectionWrapper initAndReleaseWithAuroraHostListPlugin() throws SQLException { try (ConnectionWrapper wrapper = new ConnectionWrapper( - useExecutionPlugin(), + useAuroraHostListPlugin(), CONNECTION_STRING, mockConnectionProvider)) { wrapper.releaseResources(); @@ -135,9 +135,9 @@ public ConnectionWrapper initAndReleaseWithExecutionTimePlugin() throws SQLExcep } @Benchmark - public ConnectionWrapper initAndReleaseWithAuroraHostListPlugin() throws SQLException { + public ConnectionWrapper initAndReleaseWithExecutionTimeAndAuroraHostListPlugins() throws SQLException { try (ConnectionWrapper wrapper = new ConnectionWrapper( - useAuroraHostList(), + useExecutionTimeAndAuroraHostListPlugins(), CONNECTION_STRING, mockConnectionProvider)) { wrapper.releaseResources(); @@ -196,7 +196,7 @@ public ConnectionWrapper initAndReleaseWithReadWriteSplittingPluginWithReaderLoa @Benchmark public Statement executeStatementBaseline() throws SQLException { try (ConnectionWrapper wrapper = new ConnectionWrapper( - useExecutionPlugin(), + useExecutionTimePlugin(), CONNECTION_STRING, mockConnectionProvider); Statement statement = wrapper.createStatement()) { @@ -208,7 +208,7 @@ public Statement executeStatementBaseline() throws SQLException { public ResultSet executeStatementWithExecutionTimePlugin() throws SQLException { try ( ConnectionWrapper wrapper = new ConnectionWrapper( - useExecutionPlugin(), + useExecutionTimePlugin(), CONNECTION_STRING, mockConnectionProvider); Statement statement = wrapper.createStatement(); @@ -217,21 +217,21 @@ public ResultSet executeStatementWithExecutionTimePlugin() throws SQLException { } } - Properties useAllPlugins() { + Properties useExecutionTimePlugin() { final Properties properties = new Properties(); - properties.setProperty("wrapperPlugins", "executionTime,auroraHostList"); + properties.setProperty("wrapperPlugins", "executionTime"); return properties; } - Properties useExecutionPlugin() { + Properties useAuroraHostListPlugin() { final Properties properties = new Properties(); - properties.setProperty("wrapperPlugins", "executionTime"); + properties.setProperty("wrapperPlugins", "auroraHostList"); return properties; } - Properties useAuroraHostList() { + Properties useExecutionTimeAndAuroraHostListPlugins() { final Properties properties = new Properties(); - properties.setProperty("wrapperPlugins", "auroraHostList"); + properties.setProperty("wrapperPlugins", "executionTime,auroraHostList"); return properties; } diff --git a/docs/Documentation.md b/docs/Documentation.md index fd61ad228..e29f11798 100644 --- a/docs/Documentation.md +++ b/docs/Documentation.md @@ -18,7 +18,7 @@ - [Architecture](./development-guide/Architecture.md) - [Plugin Manager](./development-guide/PluginManager.md) - [Loadable Plugins](./development-guide/LoadablePlugins.md) - - [EFM and Failover Plugin Performance Results](./development-guide/EFMAndFailoverPluginPerformanceResults.md) + - [Plugin Pipeline Performance Results](./development-guide/PluginPipelinePerformanceResults.md) - [Read-Write Splitting Plugin Performance Results](./development-guide/ReadWriteSplittingPluginPerformanceResults.md) - [Plugin Service](./development-guide/PluginService.md) - [Pipelines](./development-guide/Pipelines.md) diff --git a/docs/development-guide/DevelopmentGuide.md b/docs/development-guide/DevelopmentGuide.md index fc109a833..182fb7fb0 100644 --- a/docs/development-guide/DevelopmentGuide.md +++ b/docs/development-guide/DevelopmentGuide.md @@ -42,12 +42,12 @@ gradlew build The AWS JDBC Driver uses the following tests to verify its correctness and performance on both JVM and GraalVM: -| Tests | Description | -| --------------------------------------------- | ------------------------------------------------------------ | -| Unit tests | Tests for AWS JDBC Driver correctness. | -| Failover integration tests | Driver-specific tests for different reader and writer failover workflows using the Failover Connection Plugin. | -| Enhanced failure monitoring integration tests | Driver-specific tests for the enhanced failure monitoring functionality using the Host Monitoring Connection Plugin. | -| AWS authentication integration tests | Driver-specific tests for AWS authentication methods with the AWS Secrets Manager Plugin or the AWS IAM Authentication Plugin. | +| Tests | Description | +|-----------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------| +| Unit tests | Tests for AWS JDBC Driver correctness. | +| Failover integration tests | Driver-specific tests for different reader and writer failover workflows using the Failover Connection Plugin. | +| Enhanced failure monitoring integration tests | Driver-specific tests for the enhanced failure monitoring functionality using the Host Monitoring Connection Plugin. | +| AWS authentication integration tests | Driver-specific tests for AWS authentication methods with the AWS Secrets Manager Plugin or the AWS IAM Authentication Plugin. | | Connection plugin manager benchmarks | The [benchmarks](../../benchmarks/README.md) subproject measures the overhead from executing JDBC method calls with multiple connection plugins enabled. | ### Extra Integration Tests @@ -76,8 +76,9 @@ These benchmarks do not make actual connections to the databases and use simple The goal of these benchmarks is to measure the overhead of using the AWS JDBC Driver with multiple plugins enabled. ![](../images/jdbc_wrapper_connect_execute_pipelines_benchmarks.png) ![](../images/jdbc_wrapper_pipelines_benchmarks.png) +![](../images/jdbc_wrapper_init_release_pipelines_benchmarks.png) -See [here](EFMAndFailoverPluginPerformanceResults.md#benchmarks) for a more detailed performance breakdown. +See [here](PluginPipelinePerformanceResults.md#benchmarks) for a more detailed performance breakdown. #### Failover-specific Performance Tests The diagrams in this section show the AWS JDBC Driver's failure detection performance with or without the Failover Connection Plugin under different settings. @@ -92,7 +93,7 @@ Varying values for the network outage delay are tested, represented on the X axi This diagram shows the failover time with a 30-seconds socket timeout and different network outage delays. ![](../images/jdbc_wrapper_postgresql_failover_with_30s_socket_timeout.png) -See [here](EFMAndFailoverPluginPerformanceResults.md#failover-performance-with-30-seconds-socket-timeout-configuration) for a more detailed performance breakdown. +See [here](PluginPipelinePerformanceResults.md#failover-performance-with-30-seconds-socket-timeout-configuration) for a more detailed performance breakdown. The following diagrams show how the AWS JDBC Driver performs under a more common failure detection setting versus a more aggressive setting. @@ -118,11 +119,11 @@ For more details on failure detection settings, see [here](../using-the-jdbc-dri For more details on failover settings, see [here](../using-the-jdbc-driver/FailoverConfigurationGuide.md). ![](../images/jdbc_wrapper_postgresql_failover_efm_30000_5000_3.png) ![](../images/jdbc_wrapper_postgresql_failover_efm_6000_1000_1.png) -See [here](EFMAndFailoverPluginPerformanceResults.md#failover-performance-with-different-enhanced-failure-monitoring-configuration) for a more detailed performance breakdown. +See [here](PluginPipelinePerformanceResults.md#failover-performance-with-different-enhanced-failure-monitoring-configuration) for a more detailed performance breakdown. ![](../images/jdbc_wrapper_postgresql_efm_30000_5000_3.png) ![](../images/jdbc_wrapper_postgresql_efm_6000_1000_1.png) -See [here](EFMAndFailoverPluginPerformanceResults.md#enhanced-failure-monitoring-performance-with-different-failure-detection-configuration) for a more detailed performance breakdown. +See [here](PluginPipelinePerformanceResults.md#enhanced-failure-monitoring-performance-with-different-failure-detection-configuration) for a more detailed performance breakdown. #### Read-Write Splitting and Reader Load Balancing Performance Tests diff --git a/docs/development-guide/EFMAndFailoverPluginPerformanceResults.md b/docs/development-guide/PluginPipelinePerformanceResults.md similarity index 89% rename from docs/development-guide/EFMAndFailoverPluginPerformanceResults.md rename to docs/development-guide/PluginPipelinePerformanceResults.md index c893a70f9..4e0cbd579 100644 --- a/docs/development-guide/EFMAndFailoverPluginPerformanceResults.md +++ b/docs/development-guide/PluginPipelinePerformanceResults.md @@ -1,4 +1,4 @@ -# EFM and Failover Plugin Performance Results +# Plugin Pipeline Performance Results ## Benchmarks | Benchmark | Score | Error | Units | @@ -32,14 +32,18 @@ | releaseResourcesWithNoPlugins | 8.030 | 3.776 | us/op | | releaseResourcesTenGenericPlugins | 15.243 | 4.906 | us/op | -| Benchmark | Score | Error | Units | -|-----------------------------------------------------------|----------|---------|-------| -| executeStatementBaseline | 706.629 | 139.833 | us/op | -| executeStatementWithExecutionTimePlugin | 1037.951 | 187.424 | us/op | -| initAndReleaseBaseLine | 0.667 | 0.140 | us/op | -| initAndReleaseWithAllPlugins | 668.783 | 118.127 | us/op | -| initAndReleaseWithAuroraHostListPlugin | 667.868 | 122.335 | us/op | -| initAndReleaseWithExecutionTimePlugin | 679.230 | 136.899 | us/op | +| Benchmark | Score | Error | Units | +|------------------------------------------------------------------------------------|----------|---------|-------| +| executeStatementBaseline | 912.928 | 137.285 | us/op | +| executeStatementWithExecutionTimePlugin | 1739.314 | 286.132 | us/op | +| initAndReleaseBaseLine | 1.132 | 1.123 | us/op | +| initAndReleaseWithAuroraHostListAndReadWriteSplittingPlugin | 1562.297 | 245.078 | us/op | +| initAndReleaseWithAuroraHostListAndReadWriteSplittingPluginWithReaderLoadBalancing | 1519.943 | 243.188 | us/op | +| initAndReleaseWithAuroraHostListPlugin | 964.033 | 149.767 | us/op | +| initAndReleaseWithExecutionTimeAndAuroraHostListPlugins | 1005.531 | 165.567 | us/op | +| initAndReleaseWithExecutionTimePlugin | 804.334 | 150.357 | us/op | +| initAndReleaseWithReadWriteSplittingPlugin | 870.167 | 158.707 | us/op | +| initAndReleaseWithReadWriteSplittingPluginWithReaderLoadBalancing | 867.317 | 149.344 | us/op | ## Performance Tests diff --git a/docs/images/jdbc_wrapper_init_release_pipelines_benchmarks.png b/docs/images/jdbc_wrapper_init_release_pipelines_benchmarks.png new file mode 100644 index 000000000..c7c53a3f7 Binary files /dev/null and b/docs/images/jdbc_wrapper_init_release_pipelines_benchmarks.png differ