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

Reuse connection in MySQLHelper #478

Merged
merged 2 commits into from Jul 13, 2020
Merged

Conversation

gnuoy
Copy link
Contributor

@gnuoy gnuoy commented Jun 11, 2020

If a connection exists in MySQLHelper (self.connection) then reuse
it rather than creating a new one.

If a connection exists in MySQLHelper (self.connection) then reuse
it rather than creating a new one.
@gnuoy gnuoy changed the title Reuse connection in MySQLHelper [wip] Reuse connection in MySQLHelper Jun 11, 2020
Copy link
Contributor

@thedac thedac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am +1 on this. I also think this resolves LP Bug #1866164
https://bugs.launchpad.net/charm-mysql-innodb-cluster/+bug/1866164

@thedac thedac changed the title [wip] Reuse connection in MySQLHelper Reuse connection in MySQLHelper Jul 13, 2020
Copy link
Contributor

@thedac thedac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Manually tested with [0] successfully. Landing.

[0] https://review.opendev.org/#/c/735206/

@thedac thedac merged commit f3e8d9f into juju:master Jul 13, 2020
openstack-mirroring pushed a commit to openstack/openstack that referenced this pull request Jul 14, 2020
* Update charm-mysql-innodb-cluster from branch 'master'
  - Merge "Reuse database connections."
  - Reuse database connections.
    
    This PR should only speed up charm hook execution be reusing database
    connections. Tested with ~35 client units connected to the shared-db
    relation and execution time of db_router_respond dripped from >5mins
    to ~1min.
    
    Tested with juju/charm-helpers#478
    
    Change-Id: I9cb4937207fcd0b8045b8b67f63c5e9397decfb4
openstack-mirroring pushed a commit to openstack/charm-mysql-innodb-cluster that referenced this pull request Jul 14, 2020
This PR should only speed up charm hook execution be reusing database
connections. Tested with ~35 client units connected to the shared-db
relation and execution time of db_router_respond dripped from >5mins
to ~1min.

Tested with juju/charm-helpers#478

Change-Id: I9cb4937207fcd0b8045b8b67f63c5e9397decfb4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants