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

Disable/enable multiplexing from mysql_query_rules #594

Closed
renecannao opened this issue Jun 19, 2016 · 8 comments
Closed

Disable/enable multiplexing from mysql_query_rules #594

renecannao opened this issue Jun 19, 2016 · 8 comments

Comments

@renecannao
Copy link
Contributor

renecannao commented Jun 19, 2016

In mysql_query_rules we need to add a new variable that defines if multiplexing needs to be disabled or re-enabled.
This can be useful if:

  • we want that a specific query disables multiplexing
  • we want that multiplexing is re-enabled for example after ProxySQL thinks that is not safe to use multiplexing (ex, when @ is used)
@renecannao
Copy link
Contributor Author

Added support for mysql_query_rules.multiplex.

  • if 0 , multiplex will be disabled
  • if 1, multiplex could be re-enabled if there isn't any other conditions preventing this (like user variables or transactions)

Referencing this this into #653 .
This still doesn't solve #624

@oytuntez
Copy link

FYI, 1.3.4 does not have mysql_query_rules.multiplex

@renecannao
Copy link
Contributor Author

This feature is available in 1.4

@seanlook
Copy link

seanlook commented Apr 18, 2017

Hi, @renecannao
Multiplexing is a great feature, but I think executing several queries within one connection at a short time is quite common. Thus, no need to detach current connection to connection pool immediately after last query is done. Could it possible stay 1 second before give the connection back? (means after 1 second idle, drop the connection back to pool)

This could avoid costs when two more quries lined up in one connection and have to take&give back connection too much times.Also less custom user/session variables to swith over. It's comprimised between multiplexing and non-multiplexing, just add an variable like mysql-multiplexing-idle-before

It's helpfull to Java application that generally have its own connection pool framework.

@renecannao
Copy link
Contributor Author

@seanlook : I was thinking about this functionality about a month ago, inspired by persistence_timeout setting in keepalived (of course the context is a bit different, but the idea behind it is the same).
I will create a new issue to track this new functionality.
Thanks for the feedback

@renecannao
Copy link
Contributor Author

Created issue #999

@leeparayno
Copy link

@renecannao I'm curious about this setting. If we setup a query rule for inserts/updates/deletes to disable multiplexing on a connection, do we have to also explicitly turn it back on at the end of the session?

Our app uses long lived connections from the app server's connection pool so the connections might not be explicitly closed.

@renecannao
Copy link
Contributor Author

This is implemented. Closing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants