Skip to content
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 documentation for query priority support by the transaction throttler #1448

Merged
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 (highest priority) and 100 (lowest priority) (default: 100) |
| --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 (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.