Skip to content

Commit

Permalink
Docs: new MySQL server throttler metrics (#1878)
Browse files Browse the repository at this point in the history
* Docs: new MySQL server throttler metrics

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

* also ducmneting history_list_length metric

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

---------

Signed-off-by: Shlomi Noach <[email protected]>
  • Loading branch information
shlomi-noach authored Nov 26, 2024
1 parent c679396 commit f3ec63c
Showing 1 changed file with 20 additions and 8 deletions.
28 changes: 20 additions & 8 deletions content/en/docs/22.0/reference/features/tablet-throttler.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,13 @@ However, we limit the collaboration to specific tablet types, based on `--thrott

The objective of the throttler is to push back work based on database load. Previously, this was done based on a single metric, which could be either the replication lag, or the result of a custom query. Now, the throttler collects multiple metrics. The current supported metrics are:

- Replication lag (`lag`), measured in seconds.
- Load average (`loadavg`), per core, on the tablet server/container.
- MySQL `Threads_running` value (`threads_running`).
- Custom query (`custom`) as defined by the user.
- `lag`: replication lag, measured in seconds.
- `loadavg`: load average, per core, on the tablet server/container.
- `threads_running`: MySQL's `Threads_running` value.
- `custom`: a custom query as defined by the user.
- `mysqld-loadavg`: load average, per core, on the MySQL server/container.
- `mysqld-datadir-used-ratio`: disk space usage on MySQL's `datadir` mount, range `0.0` (empty) to `1.0` (full)
- `history_list_length`: InnoDB's history list length value.

This list is expected to expand in the future.

Expand All @@ -62,6 +65,10 @@ Each metric has a "factory default" threshold, e.g.:
- `5` (5 seconds) for `lag`.
- `1.0` (per core) for `loadavg`.
- `100` for `threads_running`.
- `1.0` (per core) for `mysqld-loadavg`.
- `0.98` (98%) for `mysqld-datadir-used-ratio`.
- `1000000000` for `history_list_length`.


Thresholds are positive values. A threshold of `0` is considered _undefined_.

Expand Down Expand Up @@ -797,20 +804,25 @@ These are the metrics by which the throttler compares with the threshold and dec
Gauge, the current metric value on the tablet. This is the result of a self-check, done continuously when the throttler is enabled. Available per metric:

- `ThrottlerAggregatedSelfCustom`
- `ThrottlerAggregatedSelfHistoryListLength`
- `ThrottlerAggregatedSelfLag`
- `ThrottlerAggregatedSelfLoadavg`
- `ThrottlerAggregatedSelfThreads_running`

- `ThrottlerAggregatedSelfThreadsRunning`
- `ThrottlerAggregatedSelfMysqldLoadavg`
- `ThrottlerAggregatedSelfMysqldDatadirUsedRatio`

##### `ThrottlerAggregatedShard<metric>`

Gauge, on the `PRIMARY` tablet only, this is the aggregated collected metric value from all serving shard tables, including the `PRIMARY`. The value is the highest (aka _worst_) of all collected tablets. Available per metric:

- `ThrottlerAggregatedShardCustom`
- `ThrottlerAggregatedShardHistoryListLength`
- `ThrottlerAggregatedShardLag`
- `ThrottlerAggregatedShardLoadavg`
- `ThrottlerAggregatedShardThreads_running`

- `ThrottlerAggregatedShardThreadsRunning`
- `ThrottlerAggregatedShardMysqldLoadavg`
- `ThrottlerAggregatedShardMysqldDatadirUsedRatio`

#### Check metrics

The throttler is checked by apps (`vreplication`, `online-ddl`, etc), and responds with status codes, "OK" for "good to proceed" or any other code for "hold off".
Expand Down

0 comments on commit f3ec63c

Please sign in to comment.