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.

This accompanies vitessio/vitess#12662

Signed-off-by: Eduardo J. Ortega U <[email protected]>
  • Loading branch information
ejortegau committed Apr 20, 2023
1 parent 0fa6130 commit 69328bf
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 @@ -401,6 +401,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 (lowest priority) and 100 (highest priority) (default: 0) |
| --tx-throttler-healthcheck-cells | strings | Synonym to -tx_throttler_healthcheck_cells |
| --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") |
| --tx_throttler_healthcheck_cells | strings | A comma-separated list of cells. Only tabletservers running in these cells will be monitored for replication lag by the transaction throttler. |
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 (lowest priority) and 100
(highest priority). The priority is used by the transaction throttler (see `--tx-throttler-...` and `-enable-tx-throttler`
flags in the `vttablet` documentation) 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 of
`1 - <query priority>`. This allows to avoid high business impact queries from being throttled (by setting their
priority to `100`) while letting less business critical ones continue to be throttled (by setting their priority to less
than `100`).
Notice that this directive has no effect if the transaction throttler is not enabled.

0 comments on commit 69328bf

Please sign in to comment.