-
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 between AWS JDBC Connector and MySQL JDBC Connecto #196
Comments
Hello @leeabuan Thank you for giving the AWS JDBC Driver for MySQL a try! The latest version 1.0.0 of the driver includes an Aurora cluster failover support and Enhanced Failure Monitoring features. These 2 new features help the driver to detect various DB cluster and network outages faster and minimize failover downtime. These features are enabled by default and they add a small footprint to overall driver performance and utilized resources. Should driver performance become a priority over DB node connection reliability, the driver could be configured accordingly. One of suggestion might be not to load Failover Plugin, and/or Enhanced Failure Monitoring Plugin. More details about driver plugins can be found at https://github.com/awslabs/aws-mysql-jdbc#connection-plugin-manager-parameters |
I think the discount is that Aurora is billed and sold as a high performance AND reliable HA database, not OR. So when the driver can't live up to that I can understand the frustration as after purchased a database that you believe does both, you are force to choose between them. Do you believe this driver will get to the same performance tier as the reference driver? |
Hello @csyperski, Agreed. We aim to keep the driver a close to performance as the reference driver. For visibility, we have identified a potential improvement for the monitoring thread that should improve performance. The monitoring thread is intended for applications that do not have much context into the timings of their query workflows. The driver does leverage the For example, the following connection attributes would need to be added to the connection string: |
Can you provide some more information ? Are you doing 1M inserts in a loop ? |
Hello @maksimsc Would you mind to provide more details?
Thank you! |
Hey @sergiyvamz, answering your questions:
We are using the following configuration params:
We are on
I would say, it is approximately 50/50 reads and writes. Most of the time it is some specific entries, selected/updated using indices.
No, we never tried mysql-connector. At least, we don't have any statistics on it for sure.
Yes, we are using hikari connection-pool with the following config:
We use spring-data-jpa and respective
Not yet, but we could give it a try
We are using the Aurora MySQL cluster with 2 nodes: 1 writer and 1 reader. Instance type is
Sure, any info on how to enable and get them? If you need anything else from me, please let me know. |
Hello @maksimsc Thank you for provided details. Driver logs can be enabled by adding a configuration parameter Since your application uses Hikari connection pool, we'd suggest to apply a solution mentioned at https://github.com/awslabs/aws-mysql-jdbc#connection-pooling |
Just adding to the conversation, in case it helps... Context, my company has been looking into migrating our main production database from single region Mysql Aurora 2.x to Aurora Global Database. Because Global Database does not support RDS Proxy, we're looking to mitigate risk of cut-over & looking at the AWS JDBC Connector to help manage failover. Looking to get a feel for the driver & seeing this thread, I ran some dumb-simple synthetic benchmarks (outside of a db-pool) just to get a sense of what we're dealing with here & how it might aid (or not) in our migration. Here's a gist of the benchmark run and the following sample, but representative, output of throughput/timing on non-global db using mysql-connector-java vs. aws-mysql-jdbc... For baseline using
On the other hand
Note the similar ~40% decrease in throughput consistent with @maksimsc's observations. Consider this a 👍 on @karenc-bq note above and on any work to improve performance of this driver.
I would love to be able to use aws-mysql-jdbc, if we can get it to get comparative performance to mysql-connector-java while gaining the advantage of some network architecture-awareness. Right now, it may not be feasible, so I'll be keeping an eye on this issue. Thank you for your work on this driver!! |
Any update on this? |
1 similar comment
Any update on this? |
Sorry the delayed response. We investigating the source of the overhead. We should have an update in the next 2 weeks. Thanks for your patience. |
The AWS JDBC Driver for MySQL needs to initialize the plugin pipeline and setup the failover plugin for every new connection, so it introduces additional performance overhead when creating new connections. @kenshih - We noticed that the benchmarks you provided create a new connection for each iteration. Here is a slightly modified benchmark based on the one you provided that reuses the same connection object. The results suggest there are minimal performance overhead (~0.4%) when executing queries with an existing connection. Could you please test it out and let us know if you still observe the performance overhead in your scenario? We recommend reusing an existing connection object, wherever possible, when executing queries to reduce performance overhead from creating new connections. During the mean time, we will keep looking for ways to optimize our connection process. |
@kenshih @chenrui333 , following up with @karenc-bq 's response. Have you been able to try the recommendation in reusing the existing connection object and seeing if the observed performance overhead persists in your scenario? |
Closing this issue due to lack of feedback. Please re-open if this is still a problem. |
We have not tried, but I found this issue very similar to this thread. Thanks! |
We can try it next week to see if things get improved or not. |
I'm submitting a performance concern...
Describe the issue
using MySQL JDBC Connector - (https://dev.mysql.com/downloads/connector/j/)
the insert takes 23 sec for inserting 1,000,000 rows
on the otherhand
using AWS JDBC Connector - (https://awslabs.github.io/aws-mysql-jdbc/)
the same insert takes 39s for inserting 1,000,000 rows
A clear and concise description of what the issue is.
Driver Version? aws-mysql-jdbc-1.0.0.jar
MySQL Version? aurora mysql 3
To Reproduce
run the following insert via java using the above drivers
"INSERT INTO test.table_row (A_COL, B_COL, C_COL) VALUES (?,?,?)"
Expected behaviour
the insert time should be the same.
The text was updated successfully, but these errors were encountered: