-
Notifications
You must be signed in to change notification settings - Fork 49
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
Performance Issues due to Thread Locking #333
Comments
I see these questions from the other thread, I can add more details:
We are using a Hikari Connection Pool.
Very simple query along the lines of
Neither had this issue.
See above.
We use Spring Data JPA, but the same issue happens even if we use plain JDBC queries. |
Hi @zromano, Thank you for reporting this issue. We will look into the problem and will share more info as we investigate. Thank you for your patience! |
@zromano Had a couple of follow up questions:
|
Whoops, copied the wrong version.
|
Okay so we did a little more testing, we actually see a 20-30% performance boost when switching from this driver to It's also worth noting that this 20-30% is on our overall response time, not just on the time we are waiting on JDBC. I wasn't sure how to measure that. Please let me know if there is any other data we can provide that might be helpful for your testing 👍 |
Hey @sergiyvamz, I just load tested our application with the following two JDBC drivers:
Summary: With the configuration I tested, I was getting ~450 requests per second over a 20 minute test period with the standard MySQL driver. When I tested the SNAPSHOT version, it peaked at around 150 RPS and then exhausted our connection pool and started throwing errors. The profile of the application still shows a large amount of locks from the |
Hello @zromano Thank you for a prompt check of the new snapshot build. It's sad to hear that the problem is still there. I'm afraid I need to ask you to provide a sample app that reproduce the issue. I'd also ask you to provide a description of tools and strategy that you use to measure locks and request throughput. Thank you! |
Unfortunately I can't provide a sample App. Our team has decided not to invest more time into this topic. 😞 However, I can provide as much info as possible though For our tech stack:
I am willing to set up a sample Spring App that I assume will repro this, but unfortunately I don't have the resources to test it. I don't want to personally pay for the AWS resources Please let me know. |
Hello @zromano Thank you for providing details about your app. We understand that there may be challenges providing a sample app including time and necessary resources to test it. Our team would be appreciated to get a sample app with no proper testing. It's important to us investigate the issue and found a root cause of such dramatic (4x) performance degradation as you reported. Thank you |
I did my best to create a sample application for you. It can be seen in: https://github.com/zromano/AWS-JDBC-Performance I tested that the app works locally, but didn't hook it up to a real AWS Aurora Mysql DB and it doesn't offer an help in terms of deploying the app on AWS. Hope this helps, please let me know if there is anything else I can do to help |
Hi @zromano, thank you for the sample application! We will take a look and keep you posted with our progress. |
Hi @zromano, I ran the sample application you provided with different versions of the AWS MySQL JDBC Driver:
In summary, we were able to reproduce the performance issues you raised with version 1.1.4 and the snapshot build. However, these issues are addressed in the latest main. More details below. v1.1.4We saw a large amount of time spent waiting for locks in the ExpiringCache class, specifically in the synchronized To resolve this issue we introduced the snapshot buildHowever, as you mentioned, the issue persists. Instead of calling mainTo resolve another issue we decided to only update topology for mission critical method calls. This change significantly reduced the number of calls to the CacheMap. While profiling we also noticed another area of improvement, we will be looking into that. We will be closing this ticket now. We appreciate the feedback and sample application in aiding in root causing this. Please let us know if there is anything else that we can provide support for while your team evaluates the driver. |
Awesome, glad to hear that and glad I could help! Thanks for fixing this 😄 |
Describe the bug
We were interested in switching our JDBC driver to the AWS MySql JDBC driver to utilize its fast failover capabilities. However, when we did performance testing with this new driver, we noticed it had a substantial performance impact to our service.
We do not experience this issue when using the
mysql-connector-j
JDBC driver.Expected Behavior
I'd expect this to have similar performance as the
mysql-connector-j
JDBC driver since this is advertised as a "drop-in compatible".Current Behavior
The JDBC driver was causing poor performance because it was causing Thread Locking due to the synchronous code in the following classes:
Reproduction Steps
We are using a SpringBoot 2.7.5 application on Java 17 backed by an Aurora Mysql DB and performing a Locust load test against it.
Sadly can't post code, but I'd think load testing a simple SpringBoot app that can communicate with Aurora would be sufficient to repro.
Possible Solution
No response
Additional Information/Context
No response
The AWS JDBC Driver for MySQL version used
1.1.2
JDK version used
17.0.5 (corretto)
Operating System and version
amazoncorretto:17 Docker Image
The text was updated successfully, but these errors were encountered: