Skip to content

Tablet throttler: custom queries and threshold#729

Merged
rohit-nayak-ps merged 2 commits intoprodfrom
throttler-custom-query-threshold
Mar 26, 2021
Merged

Tablet throttler: custom queries and threshold#729
rohit-nayak-ps merged 2 commits intoprodfrom
throttler-custom-query-threshold

Conversation

@shlomi-noach
Copy link
Contributor

Documenting the changes in vitessio/vitess#7541

This documentation change explains how to configure custom throttler queries and threshold, and the use of -throttle_check_as_check_self.

Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
@shlomi-noach shlomi-noach changed the title Tablet throttler: custom queries and threahold Tablet throttler: custom queries and threshold Mar 21, 2021
@netlify
Copy link

netlify bot commented Mar 21, 2021

Deploy preview for vitess ready!

Built with commit 85c071c

https://deploy-preview-729--vitess.netlify.app

@shlomi-noach
Copy link
Contributor Author

Copy link
Member

@hallaroo hallaroo left a comment

Choose a reason for hiding this comment

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

I had a couple grammar/link changes, but will leave @aquarapid to review the content. Thanks!

---

VTTablet runs a cooperative throttling service. This service probes the shard's MySQL topology and observes health, measure by replication lag, on servers. This throttler is derived from GitHub's [freno](https://github.com/github/freno).
VTTablet runs a cooperative throttling service. This service probes the shard's MySQL topology and observes health, measure by replication lag, or by other metric delivered by custom query, on servers. This throttler is derived from GitHub's [freno](https://github.com/github/freno).
Copy link
Member

Choose a reason for hiding this comment

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

VTTablet runs a cooperative throttling service. This service probes the shard's MySQL topology and observes health, measured by replication lag, or by another metric delivered by custom query, on servers.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed


The default behavior is to measure replication lag and throttle based on that lag. Vitess allows the user to use custom metrics and thresholds for throttling.

Vitess only supports gauges for custom metrics: the user may define a query which returns a gauge value, an absolute metric by which Vitess can throttle. See #configuration, below.
Copy link
Member

Choose a reason for hiding this comment

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

See [#configuration](../#configuration) below.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

When the throttler is enabled, it implicitly also runs heartbeat injections.
- Use the `vttablet` flag `-throttle_threshold` to set a lag threshold value. The default threshold is `1sec` and is set upon tablet startup. For example, to set a half-second lag threshold, use the flag `-throttle_threshold=0.5s`.
- To set the tablet types that the throttler queries for lag, use the `vttablet` flag `-throttle_tablet_types="replica,rdonly"`. The default tablet type is `replica`; this type is always implicitly included in the tablet types list. You may add any other tablet type. Any type not specified is ignored by the throttler.
- To override default lag evaluation, and measure a different metric, use `-throttle_metrics_query`. The query must be either of these forms:
Copy link
Member

Choose a reason for hiding this comment

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

To override the default lag evaluation, and measure a different metric, use -throttle_metrics_query.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
Copy link
Member

@hallaroo hallaroo left a comment

Choose a reason for hiding this comment

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

LGTM!

@hallaroo
Copy link
Member

I don't know if we want to wait for anyone else to review the content, but I'm happy to merge if my review is enough. Thanks!

Copy link
Member

@rohit-nayak-ps rohit-nayak-ps left a comment

Choose a reason for hiding this comment

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

lgtm

@rohit-nayak-ps rohit-nayak-ps merged commit 4c2db11 into prod Mar 26, 2021
@rohit-nayak-ps rohit-nayak-ps deleted the throttler-custom-query-threshold branch March 26, 2021 12:52
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.

3 participants