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

JDBC wrapper Increasing CPU utilization and API latency after migrating from RDS proxy #1060

Open
avnish-choudhary opened this issue Jul 11, 2024 · 3 comments
Assignees
Labels
bug Something isn't working question Further information is requested

Comments

@avnish-choudhary
Copy link

Describe the bug

we are currently using AWS RDS proxy with IAM authentication. We implement proxy mainly for failover, IAM authentication reasons.
Now after the release of new advanced jdbc wrapper we got all features inside the advanced jdbc wrapper library itself. so we want to implement this library and directly use RDS cluster with IAM authentication and failover support. we are using spring boot (2.1.8) and using hikari pool using this example: https://github.com/aws/aws-advanced-jdbc-wrapper/tree/main/examples/SpringBootHikariExample .

we observed that instance which was directly using advanced-jdbc-wrapper library was consuming lot of CPU and latency of one of the api was more than 6 seconds and same api was taking less than 1.5 second in other instance which was using AWS RDS proxy.

That api loads lot of data in memory (200 KB) and in case of parallel requests it was able to handle with proxy implementation. But same thing is failing with advanced-jdbc-wrapper.

Expected Behavior

Ideally there should be very minor difference in latency and CPU utilization.
CPU utilization without jar - 30%
CPU utilization after jar - 60%
API latency could have been near by upto 2 seconds as compared to proxy.

What plugins are used? What other connection properties were set?

readWriteSplitting,failover,efm2,iam

Current Behavior

CPU utilization without jar - 30%
CPU utilization after jar - 60%

Latency for memory intensive apis are more than 6 seconds as compared to 1.5 seconds(without wrapper).

Reproduction Steps

  1. Create 2 API which is fetching lot of data from database atleast (200 MB).
  2. Implement aws-advanced-jdbc wrapper library in spring boot (with 25 pool size)
  3. Implement AWS RDS proxy with hikari pool (with 25 pool size)
  4. Call those apis concurrently.
  5. Observe the CPU and memory utilization and also see the load in RDS cluster
  6. With proxy it is able to handle load upto some extent but with wrapper library it will start failing since beginning.

Possible Solution

No response

Additional Information/Context

No response

The AWS Advanced JDBC Driver version used

2.3.6

JDK version used

11

Operating System and version

UBUNTU 22

@avnish-choudhary avnish-choudhary added the bug Something isn't working label Jul 11, 2024
@sergiyvamz
Copy link
Contributor

Hi @avnish-choudhary ,

Thanks for reaching out and raising this issue.

Would you give more details about your application:

We'll take a look at this and keep you updated as we investigate. Thank you for your patience!

@avnish-choudhary
Copy link
Author

avnish-choudhary commented Jul 17, 2024

Hi @avnish-choudhary ,

Thanks for reaching out and raising this issue.

Would you give more details about your application:

We'll take a look at this and keep you updated as we investigate. Thank you for your patience!

Hi @sergiyvamz

we are using these wrapper plugins : readWriteSplitting,failover,efm2,iam
connection string: jdbc:aws-wrapper:postgresql://cluster-url:5432/testdb?currentSchema=example&ApplicationName=example&statement_timeout=5min

I tried both of the example and I found that its not supporting IAM authentication with internal pool (SF_F0).
is it a best way to use hikari with two datasource for reader and writer ?

@karenc-bq
Copy link
Contributor

Hi @avnish-choudhary, we have seen an issue describing a similar performance degradation in the past. Do you see the same issue with IAM disabled and are you also using a Postgres RDS instance?

To answer your question, yes we recommend setting up two datasources and disabling the readWriteSplitting plugin when using an external pool for reasons discussed here.

Could you please elaborate more on how internal pool does not work with IAM authentication? Were there connection errors? While the profile provides a set of predefined properties, client application can still override or add properties through the connection string: &wrapperPlugins=initialConnection,auroraConnectionTracker,failover,efm2,iam&iamRegion=us-west-2.

@karenc-bq karenc-bq self-assigned this Jul 19, 2024
@karenc-bq karenc-bq added the question Further information is requested label Jul 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants