Disable/enable multiplexing from mysql_query_rules #594

Open
renecannao opened this Issue Jun 19, 2016 · 7 comments

Comments

Projects
None yet
4 participants
@renecannao
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

This comment has been minimized.

Show comment
Hide comment
@renecannao

renecannao Oct 29, 2016

Contributor

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

Contributor

renecannao commented Oct 29, 2016

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

This comment has been minimized.

Show comment
Hide comment
@oytuntez

oytuntez Mar 20, 2017

FYI, 1.3.4 does not have mysql_query_rules.multiplex

FYI, 1.3.4 does not have mysql_query_rules.multiplex

@renecannao

This comment has been minimized.

Show comment
Hide comment
@renecannao

renecannao Mar 20, 2017

Contributor

This feature is available in 1.4

Contributor

renecannao commented Mar 20, 2017

This feature is available in 1.4

@seanlook

This comment has been minimized.

Show comment
Hide comment
@seanlook

seanlook 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.

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

This comment has been minimized.

Show comment
Hide comment
@renecannao

renecannao Apr 18, 2017

Contributor

@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

Contributor

renecannao commented Apr 18, 2017

@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

This comment has been minimized.

Show comment
Hide comment
@renecannao

renecannao Apr 18, 2017

Contributor

Created issue #999

Contributor

renecannao commented Apr 18, 2017

Created issue #999

@leeparayno

This comment has been minimized.

Show comment
Hide comment
@leeparayno

leeparayno Jun 29, 2017

@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 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.

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