Skip to content

Commit

Permalink
Add documentation for query priority support by the transaction throt…
Browse files Browse the repository at this point in the history
…tler (#1448)

* Add documentation for query priority support by the transaction throttler.

This accompanies vitessio/vitess#12662

Signed-off-by: Eduardo J. Ortega U <[email protected]>

* Address PR comments

Signed-off-by: Eduardo J. Ortega U <[email protected]>

* Address PR comment.

Signed-off-by: Eduardo J. Ortega U <[email protected]>

* Empty commit to re-run CI

Signed-off-by: Eduardo J. Ortega U <[email protected]>

* Update docs to reflect polarity inversion for priority directive.

Signed-off-by: Eduardo J. Ortega U <[email protected]>

* Update content/en/docs/17.0/user-guides/configuration-advanced/comment-directives.md

Signed-off-by: Harshit Gangal <[email protected]>

* Update content/en/docs/17.0/reference/programs/vttablet.md

Signed-off-by: Harshit Gangal <[email protected]>

* empty commit to kick CI

Signed-off-by: Shlomi Noach <[email protected]>

* Empty commit to re-trigger CI

Signed-off-by: Eduardo J. Ortega U <[email protected]>

* empty commit to kick CI

Signed-off-by: Shlomi Noach <[email protected]>

* empty commit to kick CI

Signed-off-by: Shlomi Noach <[email protected]>

---------

Signed-off-by: Eduardo J. Ortega U <[email protected]>
Signed-off-by: Harshit Gangal <[email protected]>
Signed-off-by: Shlomi Noach <[email protected]>
Co-authored-by: Harshit Gangal <[email protected]>
Co-authored-by: Shlomi Noach <[email protected]>
  • Loading branch information
3 people authored Aug 2, 2023
1 parent b3b5af0 commit 0f6ad7c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions content/en/docs/17.0/reference/programs/vttablet.md
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,7 @@ The following global options apply to `vttablet`:
| --twopc_coordinator_address | string | address of the (VTGate) process(es) that will be used to notify of abandoned transactions. |
| --twopc_enable | boolean | if the flag is on, 2pc is enabled. Other 2pc flags must be supplied. |
| --tx-throttler-config | string | Synonym to -tx_throttler_config (default "target_replication_lag_sec: 2\nmax_replication_lag_sec: 10\ninitial_rate: 100\nmax_increase: 1\nemergency_decrease: 0.5\nmin_duration_between_increases_sec: 40\nmax_duration_between_increases_sec: 62\nmin_duration_between_decreases_sec: 20\nspread_backlog_across_sec: 20\nage_bad_rate_after_sec: 180\nbad_rate_increase: 0.1\nmax_rate_approach_threshold: 0.9\n") |
| --tx-throttler-default-priority int | int | Default query priority used by the transaction throttler if it is not specified in a query comment directive. It must be a number between 0 (highest priority) and 100 (lowest priority) (default: 100) |
| --tx-throttler-healthcheck-cells | strings | Synonym to -tx_throttler_healthcheck_cells |
| --tx-throttler-tablet-types | strings | A comma-separated list of tablet types. Only tablets of this type are monitored for replication lag by the transaction throttler. Supported types are replica and/or rdonly. (default replica) |
| --tx_throttler_config | string | The configuration of the transaction throttler as a text formatted throttlerdata.Configuration protocol buffer message (default "target_replication_lag_sec: 2\nmax_replication_lag_sec: 10\ninitial_rate: 100\nmax_increase: 1\nemergency_decrease: 0.5\nmin_duration_between_increases_sec: 40\nmax_duration_between_increases_sec: 62\nmin_duration_between_decreases_sec: 20\nspread_backlog_across_sec: 20\nage_bad_rate_after_sec: 180\nbad_rate_increase: 0.1\nmax_rate_approach_threshold: 0.9\n") |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,15 @@ As shown above, the metrics being instrumented this way are `vttablet_query_coun
If the query lacks the `WORKLOAD_NAME` directive, the corresponding label in the metric will have the value of an empty
string. If `vttablet` is not started with `--enable-per-workload-table-metrics`, metrics are emitted without the
workload label (e.g. `vttablet_query_counts{plan="Select",table="customer"}`.
### Priority (`PRIORITY`)
Specifies the priority associated with the execution of this query, as a number between 0 (highest priority) and 100
(lowest priority). The priority is used by the transaction throttler (see `--tx-throttler-...` and `-enable-tx-throttler`
flags in the `vttablet` [documentation](../../reference/programs/vttablet.md))) to determine whether a particular query
should be throttled. If the transaction throttler determines that a query may need to be throttled, it will throttle it
with a probability equal to the provided query priority. This allows avoiding high business impact queries from being
throttled (by setting their priority to `0`) while letting less business critical ones continue to be throttled (by
setting their priority to more than `0`).
Notice that this directive has no effect if the transaction throttler is not enabled.

0 comments on commit 0f6ad7c

Please sign in to comment.