From cf746c3eed94987127d2637e7e25157ee61eb00a Mon Sep 17 00:00:00 2001 From: BayoNet Date: Wed, 31 Jul 2019 08:09:13 +0300 Subject: [PATCH] DOCAPI-3825: System tables. EN review, RU translation. (#6088) --- dbms/src/Common/CurrentMetrics.cpp | 12 +-- dbms/src/Common/ProfileEvents.cpp | 4 +- docs/en/operations/system_tables.md | 48 ++++++----- docs/ru/operations/system_tables.md | 122 ++++++++++++++++++++++++---- 4 files changed, 138 insertions(+), 48 deletions(-) diff --git a/dbms/src/Common/CurrentMetrics.cpp b/dbms/src/Common/CurrentMetrics.cpp index 2f8346d554e..070afd3b231 100644 --- a/dbms/src/Common/CurrentMetrics.cpp +++ b/dbms/src/Common/CurrentMetrics.cpp @@ -6,13 +6,13 @@ M(Query, "Number of executing queries") \ M(Merge, "Number of executing background merges") \ M(PartMutation, "Number of mutations (ALTER DELETE/UPDATE)") \ - M(ReplicatedFetch, "Number of data parts fetching from replica") \ - M(ReplicatedSend, "Number of data parts sending to replicas") \ + M(ReplicatedFetch, "Number of data parts being fetched from replica") \ + M(ReplicatedSend, "Number of data parts being sent to replicas") \ M(ReplicatedChecks, "Number of data parts checking for consistency") \ - M(BackgroundPoolTask, "Number of active tasks in BackgroundProcessingPool (merges, mutations, fetches or replication queue bookkeeping)") \ - M(BackgroundSchedulePoolTask, "Number of active tasks in BackgroundSchedulePool. This pool is used for periodic tasks of ReplicatedMergeTree like cleaning old data parts, altering data parts, replica re-initialization, etc.") \ - M(DiskSpaceReservedForMerge, "Disk space reserved for currently running background merges. It is slightly more than total size of currently merging parts.") \ - M(DistributedSend, "Number of connections sending data, that was INSERTed to Distributed tables, to remote servers. Both synchronous and asynchronous mode.") \ + M(BackgroundPoolTask, "Number of active tasks in BackgroundProcessingPool (merges, mutations, fetches, or replication queue bookkeeping)") \ + M(BackgroundSchedulePoolTask, "Number of active tasks in BackgroundSchedulePool. This pool is used for periodic ReplicatedMergeTree tasks, like cleaning old data parts, altering data parts, replica re-initialization, etc.") \ + M(DiskSpaceReservedForMerge, "Disk space reserved for currently running background merges. It is slightly more than the total size of currently merging parts.") \ + M(DistributedSend, "Number of connections to remote servers sending data that was INSERTed into Distributed tables. Both synchronous and asynchronous mode.") \ M(QueryPreempted, "Number of queries that are stopped and waiting due to 'priority' setting.") \ M(TCPConnection, "Number of connections to TCP server (clients with native interface)") \ M(HTTPConnection, "Number of connections to HTTP server") \ diff --git a/dbms/src/Common/ProfileEvents.cpp b/dbms/src/Common/ProfileEvents.cpp index 277aafa9eb8..e9b11c823ed 100644 --- a/dbms/src/Common/ProfileEvents.cpp +++ b/dbms/src/Common/ProfileEvents.cpp @@ -5,14 +5,14 @@ /// Available events. Add something here as you wish. #define APPLY_FOR_EVENTS(M) \ - M(Query, "Number of queries started to be interpreted and maybe executed. Does not include queries that are failed to parse, that are rejected due to AST size limits; rejected due to quota limits or limits on number of simultaneously running queries. May include internal queries initiated by ClickHouse itself. Does not count subqueries.") \ + M(Query, "Number of queries to be interpreted and potentially executed. Does not include queries that failed to parse or were rejected due to AST size limits, quota limits or limits on the number of simultaneously running queries. May include internal queries initiated by ClickHouse itself. Does not count subqueries.") \ M(SelectQuery, "Same as Query, but only for SELECT queries.") \ M(InsertQuery, "Same as Query, but only for INSERT queries.") \ M(FileOpen, "Number of files opened.") \ M(Seek, "Number of times the 'lseek' function was called.") \ M(ReadBufferFromFileDescriptorRead, "Number of reads (read/pread) from a file descriptor. Does not include sockets.") \ M(ReadBufferFromFileDescriptorReadFailed, "Number of times the read (read/pread) from a file descriptor have failed.") \ - M(ReadBufferFromFileDescriptorReadBytes, "Number of bytes read from file descriptors. If the file is compressed, this will show compressed data size.") \ + M(ReadBufferFromFileDescriptorReadBytes, "Number of bytes read from file descriptors. If the file is compressed, this will show the compressed data size.") \ M(WriteBufferFromFileDescriptorWrite, "Number of writes (write/pwrite) to a file descriptor. Does not include sockets.") \ M(WriteBufferFromFileDescriptorWriteFailed, "Number of times the write (write/pwrite) to a file descriptor have failed.") \ M(WriteBufferFromFileDescriptorWriteBytes, "Number of bytes written to file descriptors. If the file is compressed, this will show compressed data size.") \ diff --git a/docs/en/operations/system_tables.md b/docs/en/operations/system_tables.md index e63a9115270..6c99c299aa5 100644 --- a/docs/en/operations/system_tables.md +++ b/docs/en/operations/system_tables.md @@ -8,12 +8,12 @@ They are located in the 'system' database. ## system.asynchronous_metrics {#system_tables-asynchronous_metrics} -Contains metrics which are calculated periodically in background. For example, the amount of RAM in use. +Contains metrics that are calculated periodically in the background. For example, the amount of RAM in use. Columns: -- `metric` ([String](../data_types/string.md)) — Metric's name. -- `value` ([Float64](../data_types/float.md)) — Metric's value. +- `metric` ([String](../data_types/string.md)) — Metric name. +- `value` ([Float64](../data_types/float.md)) — Metric value. **Example** @@ -40,7 +40,7 @@ SELECT * FROM system.asynchronous_metrics LIMIT 10 - [Monitoring](monitoring.md) — Base concepts of ClickHouse monitoring. - [system.metrics](#system_tables-metrics) — Contains instantly calculated metrics. -- [system.events](#system_tables-events) — Contains a number of happened events. +- [system.events](#system_tables-events) — Contains a number of events that have occurred. ## system.clusters @@ -48,7 +48,7 @@ Contains information about clusters available in the config file and the servers Columns: ``` -cluster String — The cluster name. +cluster String — The cluster name. shard_num UInt32 — The shard number in the cluster, starting from 1. shard_weight UInt32 — The relative weight of the shard when writing data. replica_num UInt32 — The replica number in the shard, starting from 1. @@ -119,13 +119,13 @@ Note that the amount of memory used by the dictionary is not proportional to the ## system.events {#system_tables-events} -Contains information about the number of events that have occurred in the system. For example, in the table, you can find how many `SELECT` queries are processed from the moment of ClickHouse server start. +Contains information about the number of events that have occurred in the system. For example, in the table, you can find how many `SELECT` queries were processed since the ClickHouse server started. Columns: - `event` ([String](../data_types/string.md)) — Event name. -- `value` ([UInt64](../data_types/int_uint.md)) — Count of events occurred. -- `description` ([String](../data_types/string.md)) — Description of an event. +- `value` ([UInt64](../data_types/int_uint.md)) — Number of events occurred. +- `description` ([String](../data_types/string.md)) — Event description. **Example** @@ -135,11 +135,11 @@ SELECT * FROM system.events LIMIT 5 ```text ┌─event─────────────────────────────────┬─value─┬─description────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ -│ Query │ 12 │ Number of queries started to be interpreted and maybe executed. Does not include queries that are failed to parse, that are rejected due to AST size limits; rejected due to quota limits or limits on number of simultaneously running queries. May include internal queries initiated by ClickHouse itself. Does not count subqueries. │ +│ Query │ 12 │ Number of queries to be interpreted and potentially executed. Does not include queries that failed to parse or were rejected due to AST size limits, quota limits or limits on the number of simultaneously running queries. May include internal queries initiated by ClickHouse itself. Does not count subqueries. │ │ SelectQuery │ 8 │ Same as Query, but only for SELECT queries. │ │ FileOpen │ 73 │ Number of files opened. │ │ ReadBufferFromFileDescriptorRead │ 155 │ Number of reads (read/pread) from a file descriptor. Does not include sockets. │ -│ ReadBufferFromFileDescriptorReadBytes │ 9931 │ Number of bytes read from file descriptors. If the file is compressed, this will show compressed data size. │ +│ ReadBufferFromFileDescriptorReadBytes │ 9931 │ Number of bytes read from file descriptors. If the file is compressed, this will show the compressed data size. │ └───────────────────────────────────────┴───────┴────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ ``` @@ -197,13 +197,13 @@ Columns: ## system.metrics {#system_tables-metrics} -Contains metrics which can be calculated instantly, or have an current value. For example, a number of simultaneously processed queries, the current value for replica delay. This table is always up to date. +Contains metrics which can be calculated instantly, or have a current value. For example, the number of simultaneously processed queries or the current replica delay. This table is always up to date. Columns: -- `metric` ([String](../data_types/string.md)) — Metric's name. -- `value` ([Int64](../data_types/int_uint.md)) — Metric's value. -- `description` ([String](../data_types/string.md)) — Description of the metric. +- `metric` ([String](../data_types/string.md)) — Metric name. +- `value` ([Int64](../data_types/int_uint.md)) — Metric value. +- `description` ([String](../data_types/string.md)) — Metric description. **Example** @@ -216,19 +216,19 @@ SELECT * FROM system.metrics LIMIT 10 │ Query │ 1 │ Number of executing queries │ │ Merge │ 0 │ Number of executing background merges │ │ PartMutation │ 0 │ Number of mutations (ALTER DELETE/UPDATE) │ -│ ReplicatedFetch │ 0 │ Number of data parts fetching from replica │ -│ ReplicatedSend │ 0 │ Number of data parts sending to replicas │ +│ ReplicatedFetch │ 0 │ Number of data parts being fetched from replicas │ +│ ReplicatedSend │ 0 │ Number of data parts being sent to replicas │ │ ReplicatedChecks │ 0 │ Number of data parts checking for consistency │ -│ BackgroundPoolTask │ 0 │ Number of active tasks in BackgroundProcessingPool (merges, mutations, fetches or replication queue bookkeeping) │ -│ BackgroundSchedulePoolTask │ 0 │ Number of active tasks in BackgroundSchedulePool. This pool is used for periodic tasks of ReplicatedMergeTree like cleaning old data parts, altering data parts, replica re-initialization, etc. │ -│ DiskSpaceReservedForMerge │ 0 │ Disk space reserved for currently running background merges. It is slightly more than total size of currently merging parts. │ -│ DistributedSend │ 0 │ Number of connections sending data, that was INSERTed to Distributed tables, to remote servers. Both synchronous and asynchronous mode. │ +│ BackgroundPoolTask │ 0 │ Number of active tasks in BackgroundProcessingPool (merges, mutations, fetches, or replication queue bookkeeping) │ +│ BackgroundSchedulePoolTask │ 0 │ Number of active tasks in BackgroundSchedulePool. This pool is used for periodic ReplicatedMergeTree tasks, like cleaning old data parts, altering data parts, replica re-initialization, etc. │ +│ DiskSpaceReservedForMerge │ 0 │ Disk space reserved for currently running background merges. It is slightly more than the total size of currently merging parts. │ +│ DistributedSend │ 0 │ Number of connections to remote servers sending data that was INSERTed into Distributed tables. Both synchronous and asynchronous mode. │ └────────────────────────────┴───────┴──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ ``` **See Also** - [system.asynchronous_metrics](#system_tables-asynchronous_metrics) — Contains periodically calculated metrics. -- [system.events](#system_tables-events) — Contains a umber of happened events. +- [system.events](#system_tables-events) — Contains a number of events that occurred. - [Monitoring](monitoring.md) — Base concepts of ClickHouse monitoring. ## system.numbers @@ -368,7 +368,7 @@ To enable query logging, set the parameter [log_queries](settings/settings.md#se The `system.query_log` table registers two kinds of queries: 1. Initial queries, that were run directly by the client. -2. Child queries that were initiated by other queries (for distributed query execution). For such a kind of queries, information about the parent queries is shown in the `initial_*` columns. +2. Child queries that were initiated by other queries (for distributed query execution). For such queries, information about parent queries is shown in the `initial_*` columns. Columns: @@ -391,9 +391,7 @@ Columns: - `query` (String) — Query string. - `exception` (String) — Exception message. - `stack_trace` (String) — Stack trace (a list of methods called before the error occurred). An empty string, if the query is completed successfully. -- `is_initial_query` (UInt8) — Kind of query. Possible values: - - 1 — Query was initiated by the client. - - 0 — Query was initiated by another query for distributed query execution. +- `is_initial_query` (UInt8) — Flag that indicates whether the query is initiated by the client (1), or by another query for distributed query execution (0). - `user` (String) — Name of the user initiated the current query. - `query_id` (String) — ID of the query. - `address` (FixedString(16)) — IP address the query was initiated from. diff --git a/docs/ru/operations/system_tables.md b/docs/ru/operations/system_tables.md index eb452c8de4e..da58fbe9ca1 100644 --- a/docs/ru/operations/system_tables.md +++ b/docs/ru/operations/system_tables.md @@ -8,10 +8,39 @@ ## system.asynchronous_metrics {#system_tables-asynchronous_metrics} -Содержат метрики, используемые для профилирования и мониторинга. -Обычно отражают количество событий, происходящих в данный момент в системе, или ресурсов, суммарно потребляемых системой. -Пример: количество запросов типа SELECT, исполняемых в текущий момент; количество потребляемой памяти. -`system.asynchronous_metrics` и `system.metrics` отличаются набором и способом вычисления метрик. +Содержит метрики, которые периодически вычисляются в фоновом режиме. Например, объем используемой оперативной памяти. + +Столбцы: + +- `metric` ([String](../data_types/string.md)) — название метрики. +- `value` ([Float64](../data_types/float.md)) — значение метрики. + +**Пример** + +```sql +SELECT * FROM system.asynchronous_metrics LIMIT 10 +``` + +```text +┌─metric──────────────────────────────────┬──────value─┐ +│ jemalloc.background_thread.run_interval │ 0 │ +│ jemalloc.background_thread.num_runs │ 0 │ +│ jemalloc.background_thread.num_threads │ 0 │ +│ jemalloc.retained │ 422551552 │ +│ jemalloc.mapped │ 1682989056 │ +│ jemalloc.resident │ 1656446976 │ +│ jemalloc.metadata_thp │ 0 │ +│ jemalloc.metadata │ 10226856 │ +│ UncompressedCacheCells │ 0 │ +│ MarkCacheFiles │ 0 │ +└─────────────────────────────────────────┴────────────┘ +``` + +**Смотрите также** + +- [Мониторинг](monitoring.md) — основы мониторинга в ClickHouse. +- [system.metrics](#system_tables-metrics) — таблица с мгновенно вычисляемыми метриками. +- [system.events](#system_tables-events) — таблица с количеством произошедших событий. ## system.clusters @@ -19,15 +48,16 @@ Столбцы: ``` -cluster String - имя кластера -shard_num UInt32 - номер шарда в кластере, начиная с 1 -shard_weight UInt32 - относительный вес шарда при записи данных -replica_num UInt32 - номер реплики в шарде, начиная с 1 -host_name String - имя хоста, как прописано в конфиге -host_address String - IP-адрес хоста, полученный из DNS -port UInt16 - порт, на который обращаться для соединения с сервером -user String - имя пользователя, которого использовать для соединения с сервером +cluster String — имя кластера. +shard_num UInt32 — номер шарда в кластере, начиная с 1. +shard_weight UInt32 — относительный вес шарда при записи данных +replica_num UInt32 — номер реплики в шарде, начиная с 1. +host_name String — хост, указанный в конфигурации. +host_address String — IP-адрес хоста, полученный из DNS. +port UInt16 — порт, на который обращаться для соединения с сервером. +user String — имя пользователя, которого использовать для соединения с сервером. ``` + ## system.columns Содержит информацию о столбцах всех таблиц. @@ -72,9 +102,35 @@ default_expression String - выражение для значения по ум ## system.events {#system_tables-events} -Содержит информацию о количестве произошедших в системе событий, для профилирования и мониторинга. -Пример: количество обработанных запросов типа SELECT. -Столбцы: event String - имя события, value UInt64 - количество. +Содержит информацию о количестве событий, произошедших в системе. Например, в таблице можно найти, сколько запросов `SELECT` обработано с момента запуска сервера ClickHouse. + +Столбцы: + +- `event` ([String](../data_types/string.md)) — имя события. +- `value` ([UInt64](../data_types/int_uint.md)) — количество произошедших событий. +- `description` ([String](../data_types/string.md)) — описание события. + +**Пример** + +```sql +SELECT * FROM system.events LIMIT 5 +``` + +```text +┌─event─────────────────────────────────┬─value─┬─description────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ +│ Query │ 12 │ Number of queries to be interpreted and potentially executed. Does not include queries that failed to parse or were rejected due to AST size limits, quota limits or limits on the number of simultaneously running queries. May include internal queries initiated by ClickHouse itself. Does not count subqueries. │ +│ SelectQuery │ 8 │ Same as Query, but only for SELECT queries. │ +│ FileOpen │ 73 │ Number of files opened. │ +│ ReadBufferFromFileDescriptorRead │ 155 │ Number of reads (read/pread) from a file descriptor. Does not include sockets. │ +│ ReadBufferFromFileDescriptorReadBytes │ 9931 │ Number of bytes read from file descriptors. If the file is compressed, this will show the compressed data size. │ +└───────────────────────────────────────┴───────┴────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ +``` + +**Смотрите также** + +- [system.asynchronous_metrics](#system_tables-asynchronous_metrics) — таблица с периодически вычисляемыми метриками. +- [system.metrics](#system_tables-metrics) — таблица с мгновенно вычисляемыми метриками. +- [Мониторинг](monitoring.md) — основы мониторинга в ClickHouse. ## system.functions @@ -123,11 +179,47 @@ default_expression String - выражение для значения по ум ## system.metrics {#system_tables-metrics} +Содержит метрики, которые могут быть рассчитаны мгновенно или имеют текущее значение. Например, число одновременно обрабатываемых запросов или текущее значение задержки реплики. Эта таблица всегда актуальна. + +Столбцы: + +- `metric` ([String](../data_types/string.md)) — название метрики. +- `value` ([Int64](../data_types/int_uint.md)) — значение метрики. +- `description` ([String](../data_types/string.md)) — описание метрики. + +**Пример** + +```sql +SELECT * FROM system.metrics LIMIT 10 +``` + +```text +┌─metric─────────────────────┬─value─┬─description──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ +│ Query │ 1 │ Number of executing queries │ +│ Merge │ 0 │ Number of executing background merges │ +│ PartMutation │ 0 │ Number of mutations (ALTER DELETE/UPDATE) │ +│ ReplicatedFetch │ 0 │ Number of data parts being fetched from replicas │ +│ ReplicatedSend │ 0 │ Number of data parts being sent to replicas │ +│ ReplicatedChecks │ 0 │ Number of data parts checking for consistency │ +│ BackgroundPoolTask │ 0 │ Number of active tasks in BackgroundProcessingPool (merges, mutations, fetches, or replication queue bookkeeping) │ +│ BackgroundSchedulePoolTask │ 0 │ Number of active tasks in BackgroundSchedulePool. This pool is used for periodic ReplicatedMergeTree tasks, like cleaning old data parts, altering data parts, replica re-initialization, etc. │ +│ DiskSpaceReservedForMerge │ 0 │ Disk space reserved for currently running background merges. It is slightly more than the total size of currently merging parts. │ +│ DistributedSend │ 0 │ Number of connections to remote servers sending data that was INSERTed into Distributed tables. Both synchronous and asynchronous mode. │ +└────────────────────────────┴───────┴──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ +``` + +**Смотрите также** + +- [system.asynchronous_metrics](#system_tables-asynchronous_metrics) — таблица с периодически вычисляемыми метриками. +- [system.events](#system_tables-events) — таблица с количеством произошедших событий. +- [Мониторинг](monitoring.md) — основы мониторинга в ClickHouse. + ## system.numbers Таблица содержит один столбец с именем number типа UInt64, содержащим почти все натуральные числа, начиная с нуля. Эту таблицу можно использовать для тестов, а также если вам нужно сделать перебор. Чтения из этой таблицы не распараллеливаются. + ## system.numbers_mt То же самое, что и system.numbers, но чтение распараллеливается. Числа могут возвращаться в произвольном порядке.