-
Notifications
You must be signed in to change notification settings - Fork 982
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
Add a "demuxed" status to proxysql_connection_pool_conn to track connections with multiplexing disabled #4474
base: v2.x
Are you sure you want to change the base?
Conversation
Hi @saunderst .
When One could argue that the dirty read is not a serious problem, because in the worse case it can return a slightly incorrect result. Finally, I am concerned about the performance cost of inspecting all used connections. So my question is: maybe it is worth investigating a completely different approach? It is worth to note that counterX would be a counter and not a gauge. Finally, using this new counter doesn't provide the same information you are trying to achieve with this PR (how many connections have multiplexing disabled) , but provides a metric to determine how efficient is multiplexing. Thoughts? |
Hi @renecannao. Thanks for the feedback. I had considered the dirty read problem, and decided as you said that a slightly incorrect value is acceptable, since we're just using the metric to spot major problems. I was also concerned about the performance impact, but decided it was probably okay for our numbers of backend connections per ProxySQL instance and how often we're hitting the Prometheus endpoint. However, maybe those assumptions can't be generalized across all ProxySQL users, and I am interested in exploring your alternative suggestion a bit more. Would it be accurate to say that the |
This PR was closed by mistake. Reopening |
Can one of the admins verify this patch? |
This is a feature we've found highly useful on a daily basis in our dashboards and alerts. I've implemented it as an additional status label on
proxysql_connection_pool_conn
.Question for reviewers: Would it be better as an entirely new metric?
Here's a simple illustration of the metric in use. First, we use
GET_LOCK()
to open a connection with multiplexing disabled:Note that the demultiplexed connection is counted twice, as both
used
anddemuxed
.Now execute a long-running query in one of the other client sessions. Now we have two
used
connections, but still just onedemuxed
.Release the lock and free the de-multiplexed connection:
Finally, the other query completes and we have two free connections in the pool: