-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Tablet throttler: support for custom query & threshold #7541
Tablet throttler: support for custom query & threshold #7541
Conversation
…ottle_metrics_threshold Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
Testing TBD via |
Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
(still draft; will take out of draft mode when tests are satisfied) |
…o interpret a SHOW GLOBAL query. Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
Added support for |
…s_self_check Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
Ready for review. |
Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
Kind ping, cc @aquarapid |
ping for review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work! LGTM
I'm going to merge this now. If there are other comments, they can be handled in a separate PR. |
Validated as described; thanks! The only additional feature request I would have is to add the metric threshold to the |
Creating a separate issue for that |
Description
This PR introduces
vttablet
command line flags, which allow the user to customize the tablet throttler behavior:-throttle_metrics_query
(string)-throttle_metrics_threshold
(float)-throttle_check_as_check_self
(bool)The default behavior is for the throttler to check replication lag (where the lag threshold can be customized via the already existing
-throttle_threshold
).However, the user may want to run a custom query. They are allowed to run:
SELECT
query that returns a single row, single value, float/numeric data typeSHOW GLOBAL (STATUS|VARIABLES) LIKE '<variable-name>'
An example use case would be:
vttablet -throttle_metrics_query "show global status like 'threads_running'" -throttle_metrics_threshold 150 -throttle_check_as_check_self
The flag
throttle_check_as_check_self
is desired because the default throttler behavior, for writes, is to consider the overall health of the shard: the default check is for replication lag, and the throttler runs the lag evaluation query on all replicas on the shard. However, if the user wants to measure e.g.Threads_running
on the primary only, then the flagthrottle_check_as_check_self
treats any write-check as "check-self" request, which only reads metrics on the specific tablet.Checklist
Impacted Areas in Vitess
Components that this PR will affect: