diff --git a/docs/user-guide/deployments-administration/configuration.md b/docs/user-guide/deployments-administration/configuration.md index 7ba717edb..75ebba7df 100644 --- a/docs/user-guide/deployments-administration/configuration.md +++ b/docs/user-guide/deployments-administration/configuration.md @@ -795,6 +795,28 @@ scan mode. Review its alert thresholds when changing modes or upgrading. See the [scan-memory upgrade guidance](/user-guide/deployments-administration/upgrade.md#scan-memory-accounting-changes) for changes that affect existing configurations. +`greptime_mito_scan_max_concurrent_files` is a Prometheus histogram (labeled by +`type="query"` or `type="compaction"`) that records the planned maximum number +of concurrent files per region scan evaluation or compaction reader, rather than +the live count of currently open files: + +- `type="query"`: recorded when evaluating scan limits for sequential and series + region scans. It counts planned concurrent sources (including memtable + sources) for that region scan evaluation, including scans rejected by + `max_concurrent_scan_files` and scans covered by `scan_memory_limit`. A single + SQL query can produce multiple region scan evaluations. +- `type="compaction"`: recorded when building a compaction reader. It counts all + input SST files merged by that reader. + +The official Grafana dashboards display p95, p99, and average values for this +metric in the **Scan Max Concurrent Files per Instance** panel. The p95 and p99 +series are histogram estimates, not exact per-query maxima. If many +`type="query"` evaluations exceed 100 concurrent files, check +[`INFORMATION_SCHEMA.SSTS_MANIFEST`](/reference/sql/information-schema/ssts-manifest.md) +for excessive small SST files and see +[Queries fail with `Too many files to read concurrently`](/faq-and-others/faq.md#queries-fail-with-too-many-files-to-read-concurrently-what-should-i-do) +for diagnosis and compaction steps. + ### Specify meta client The `meta_client` options are valid in `datanode` and `frontend` mode, which specify the Metasrv client information. diff --git a/docs/user-guide/deployments-administration/performance-tuning/performance-tuning-tips.md b/docs/user-guide/deployments-administration/performance-tuning/performance-tuning-tips.md index 2188e9064..7e0478b4a 100644 --- a/docs/user-guide/deployments-administration/performance-tuning/performance-tuning-tips.md +++ b/docs/user-guide/deployments-administration/performance-tuning/performance-tuning-tips.md @@ -56,11 +56,14 @@ The following metrics help diagnose query performance issues: | Metric | Type | Description | |---|---|---| | greptime_mito_read_stage_elapsed_bucket | histogram | The elapsed time of different phases of a query in the storage engine. | +| greptime_mito_scan_max_concurrent_files | histogram | Planned maximum concurrent files (including memtable sources for queries) per region scan limit evaluation or compaction reader, labeled by `type` (`query` or `compaction`). Reflects planned scan concurrency rather than live open files. See [Scan memory accounting](/user-guide/deployments-administration/configuration.md#scan-memory-accounting). | | greptime_mito_cache_bytes | gauge | Size of cached contents. The `type` label indicates the cache type. | | greptime_mito_cache_hit | counter | Total count of cache hit. The `type` label indicates the cache type. | | greptime_mito_cache_miss | counter | Total count of cache miss. The `type` label indicates the cache type. | | greptime_mito_cache_eviction | counter | Total count of cache eviction. The `type` label indicates the cache type. | +If `greptime_mito_scan_max_concurrent_files` with `type="query"` shows many scan evaluations exceeding 100 concurrent files, your tables may have too many small SST files. Inspect [`INFORMATION_SCHEMA.SSTS_MANIFEST`](/reference/sql/information-schema/ssts-manifest.md) and see [Queries fail with `Too many files to read concurrently`](/faq-and-others/faq.md#queries-fail-with-too-many-files-to-read-concurrently-what-should-i-do) for diagnosis and compaction steps. + ### Enlarging cache size diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/deployments-administration/configuration.md b/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/deployments-administration/configuration.md index 6a4c535c6..6e911c384 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/deployments-administration/configuration.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/deployments-administration/configuration.md @@ -788,6 +788,23 @@ Mito 根据表选项和 SST format 为每个 Region 选择 memtable 实现。`de 切换模式或升级时,请检查相关告警阈值。现有配置受哪些影响,请参阅 [扫描内存升级指南](/user-guide/deployments-administration/upgrade.md#扫描内存计量变更)。 +`greptime_mito_scan_max_concurrent_files` 是一个 Prometheus histogram 指标(带 +`type="query"` 或 `type="compaction"` 标签),用于记录每次 region 扫描限制评估或 +compaction reader 计划并发扫描的文件数,而不是当前同时打开的文件数: + +- `type="query"`:在对顺序扫描(sequential scan)和序列扫描(series scan)执行 + region 扫描限制评估时记录,统计该次评估计划并发读取的数据源数量(包含 memtable + 数据源),覆盖因超过 `max_concurrent_scan_files` 被拒绝的扫描以及使用 + `scan_memory_limit` 控制的扫描。一条 SQL 查询可能产生多次 region 扫描评估。 +- `type="compaction"`:在构建 compaction reader 时记录,统计该 reader 合并的全部输入 + SST 文件数量。 + +官方 Grafana 仪表盘的 **Scan Max Concurrent Files per Instance** 面板展示了该指标的 +p95、p99 和平均值。其中的 p95 和 p99 是基于直方图桶估算的分位数,不代表单条查询的精确 +最大值。如果大量 `type="query"` 评估超过 100 个并发文件,可能存在过多小 SST 文件;请查询 +[`INFORMATION_SCHEMA.SSTS_MANIFEST`](/reference/sql/information-schema/ssts-manifest.md) +排查,并参考[查询报 `Too many files to read concurrently` 怎么处理](/faq-and-others/faq.md#查询报-too-many-files-to-read-concurrently-怎么处理)执行诊断和 compaction。 + ### 设定 meta client `meta_client` 选项适用于 `datanode` 和 `frontend` 模块,用于指定 Metasrv 的相关信息。 diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/deployments-administration/performance-tuning/performance-tuning-tips.md b/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/deployments-administration/performance-tuning/performance-tuning-tips.md index 4731f080e..6fd35a209 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/deployments-administration/performance-tuning/performance-tuning-tips.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/user-guide/deployments-administration/performance-tuning/performance-tuning-tips.md @@ -56,11 +56,14 @@ EXPLAIN ANALYZE VERBOSE ; | 指标 | 类型 | 描述 | |---|---|---| | greptime_mito_read_stage_elapsed_bucket | histogram | 存储引擎中查询不同阶段的耗时。 | +| greptime_mito_scan_max_concurrent_files | histogram | 每次 region 扫描限制评估或 compaction reader 计划并发扫描的文件数(查询包含 memtable 数据源),通过 `type` 标签区分 `query` 和 `compaction`。反映的是计划并发扫描数,而非当前同时打开的文件数。详见[扫描内存计量](/user-guide/deployments-administration/configuration.md#扫描内存计量)。 | | greptime_mito_cache_bytes | gauge | 缓存内容的大小。`type` 标签表示缓存类型。 | | greptime_mito_cache_hit | counter | 缓存命中总数。`type` 标签表示缓存类型。 | | greptime_mito_cache_miss | counter | 缓存未命中总数。`type` 标签表示缓存类型。 | | greptime_mito_cache_eviction | counter | 缓存淘汰总数。`type` 标签表示缓存类型。 | +如果 `greptime_mito_scan_max_concurrent_files`(`type="query"`)显示大量扫描评估超过 100 个并发文件,可能说明表中存在过多小 SST 文件。可以查询 [`INFORMATION_SCHEMA.SSTS_MANIFEST`](/reference/sql/information-schema/ssts-manifest.md) 排查,并参考[查询报 `Too many files to read concurrently` 怎么处理](/faq-and-others/faq.md#查询报-too-many-files-to-read-concurrently-怎么处理)执行诊断和 compaction。 + ### 增大缓存大小 将 `greptime_mito_cache_bytes{type="..."}` 作为判断缓存压力的主要信号。如果该指标经常接近对应缓存的配置容量,可以考虑增大该缓存。如果该指标长期远低于容量,可以考虑减小该缓存,为其他缓存释放内存或磁盘空间。使用 `greptime_mito_cache_hit`、`greptime_mito_cache_miss` 和 `greptime_mito_cache_eviction` 作为辅助信号,判断调整某个缓存是否有价值。 diff --git a/i18n/zh/docusaurus-plugin-content-docs/version-1.3/user-guide/deployments-administration/configuration.md b/i18n/zh/docusaurus-plugin-content-docs/version-1.3/user-guide/deployments-administration/configuration.md index 45d1d5195..61e7899cf 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/version-1.3/user-guide/deployments-administration/configuration.md +++ b/i18n/zh/docusaurus-plugin-content-docs/version-1.3/user-guide/deployments-administration/configuration.md @@ -773,6 +773,23 @@ Mito 根据表选项和 SST format 为每个 Region 选择 memtable 实现。`de 切换模式或升级时,请检查相关告警阈值。现有配置受哪些影响,请参阅 [扫描内存升级指南](/user-guide/deployments-administration/upgrade.md#扫描内存计量变更)。 +`greptime_mito_scan_max_concurrent_files` 是一个 Prometheus histogram 指标(带 +`type="query"` 或 `type="compaction"` 标签),用于记录每次 region 扫描限制评估或 +compaction reader 计划并发扫描的文件数,而不是当前同时打开的文件数: + +- `type="query"`:在对顺序扫描(sequential scan)和序列扫描(series scan)执行 + region 扫描限制评估时记录,统计该次评估计划并发读取的数据源数量(包含 memtable + 数据源),覆盖因超过 `max_concurrent_scan_files` 被拒绝的扫描以及使用 + `scan_memory_limit` 控制的扫描。一条 SQL 查询可能产生多次 region 扫描评估。 +- `type="compaction"`:在构建 compaction reader 时记录,统计该 reader 合并的全部输入 + SST 文件数量。 + +官方 Grafana 仪表盘的 **Scan Max Concurrent Files per Instance** 面板展示了该指标的 +p95、p99 和平均值。其中的 p95 和 p99 是基于直方图桶估算的分位数,不代表单条查询的精确 +最大值。如果大量 `type="query"` 评估超过 100 个并发文件,可能存在过多小 SST 文件;请查询 +[`INFORMATION_SCHEMA.SSTS_MANIFEST`](/reference/sql/information-schema/ssts-manifest.md) +排查,并参考[查询报 `Too many files to read concurrently` 怎么处理](/faq-and-others/faq.md#查询报-too-many-files-to-read-concurrently-怎么处理)执行诊断和 compaction。 + ### 设定 meta client `meta_client` 选项适用于 `datanode` 和 `frontend` 模块,用于指定 Metasrv 的相关信息。 diff --git a/i18n/zh/docusaurus-plugin-content-docs/version-1.3/user-guide/deployments-administration/performance-tuning/performance-tuning-tips.md b/i18n/zh/docusaurus-plugin-content-docs/version-1.3/user-guide/deployments-administration/performance-tuning/performance-tuning-tips.md index 4731f080e..6fd35a209 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/version-1.3/user-guide/deployments-administration/performance-tuning/performance-tuning-tips.md +++ b/i18n/zh/docusaurus-plugin-content-docs/version-1.3/user-guide/deployments-administration/performance-tuning/performance-tuning-tips.md @@ -56,11 +56,14 @@ EXPLAIN ANALYZE VERBOSE ; | 指标 | 类型 | 描述 | |---|---|---| | greptime_mito_read_stage_elapsed_bucket | histogram | 存储引擎中查询不同阶段的耗时。 | +| greptime_mito_scan_max_concurrent_files | histogram | 每次 region 扫描限制评估或 compaction reader 计划并发扫描的文件数(查询包含 memtable 数据源),通过 `type` 标签区分 `query` 和 `compaction`。反映的是计划并发扫描数,而非当前同时打开的文件数。详见[扫描内存计量](/user-guide/deployments-administration/configuration.md#扫描内存计量)。 | | greptime_mito_cache_bytes | gauge | 缓存内容的大小。`type` 标签表示缓存类型。 | | greptime_mito_cache_hit | counter | 缓存命中总数。`type` 标签表示缓存类型。 | | greptime_mito_cache_miss | counter | 缓存未命中总数。`type` 标签表示缓存类型。 | | greptime_mito_cache_eviction | counter | 缓存淘汰总数。`type` 标签表示缓存类型。 | +如果 `greptime_mito_scan_max_concurrent_files`(`type="query"`)显示大量扫描评估超过 100 个并发文件,可能说明表中存在过多小 SST 文件。可以查询 [`INFORMATION_SCHEMA.SSTS_MANIFEST`](/reference/sql/information-schema/ssts-manifest.md) 排查,并参考[查询报 `Too many files to read concurrently` 怎么处理](/faq-and-others/faq.md#查询报-too-many-files-to-read-concurrently-怎么处理)执行诊断和 compaction。 + ### 增大缓存大小 将 `greptime_mito_cache_bytes{type="..."}` 作为判断缓存压力的主要信号。如果该指标经常接近对应缓存的配置容量,可以考虑增大该缓存。如果该指标长期远低于容量,可以考虑减小该缓存,为其他缓存释放内存或磁盘空间。使用 `greptime_mito_cache_hit`、`greptime_mito_cache_miss` 和 `greptime_mito_cache_eviction` 作为辅助信号,判断调整某个缓存是否有价值。 diff --git a/versioned_docs/version-1.3/user-guide/deployments-administration/configuration.md b/versioned_docs/version-1.3/user-guide/deployments-administration/configuration.md index 770d27df6..d65f9ddf2 100644 --- a/versioned_docs/version-1.3/user-guide/deployments-administration/configuration.md +++ b/versioned_docs/version-1.3/user-guide/deployments-administration/configuration.md @@ -773,6 +773,28 @@ scan mode. Review its alert thresholds when changing modes or upgrading. See the [scan-memory upgrade guidance](/user-guide/deployments-administration/upgrade.md#scan-memory-accounting-changes) for changes that affect existing configurations. +`greptime_mito_scan_max_concurrent_files` is a Prometheus histogram (labeled by +`type="query"` or `type="compaction"`) that records the planned maximum number +of concurrent files per region scan evaluation or compaction reader, rather than +the live count of currently open files: + +- `type="query"`: recorded when evaluating scan limits for sequential and series + region scans. It counts planned concurrent sources (including memtable + sources) for that region scan evaluation, including scans rejected by + `max_concurrent_scan_files` and scans covered by `scan_memory_limit`. A single + SQL query can produce multiple region scan evaluations. +- `type="compaction"`: recorded when building a compaction reader. It counts all + input SST files merged by that reader. + +The official Grafana dashboards display p95, p99, and average values for this +metric in the **Scan Max Concurrent Files per Instance** panel. The p95 and p99 +series are histogram estimates, not exact per-query maxima. If many +`type="query"` evaluations exceed 100 concurrent files, check +[`INFORMATION_SCHEMA.SSTS_MANIFEST`](/reference/sql/information-schema/ssts-manifest.md) +for excessive small SST files and see +[Queries fail with `Too many files to read concurrently`](/faq-and-others/faq.md#queries-fail-with-too-many-files-to-read-concurrently-what-should-i-do) +for diagnosis and compaction steps. + ### Specify meta client The `meta_client` options are valid in `datanode` and `frontend` mode, which specify the Metasrv client information. diff --git a/versioned_docs/version-1.3/user-guide/deployments-administration/performance-tuning/performance-tuning-tips.md b/versioned_docs/version-1.3/user-guide/deployments-administration/performance-tuning/performance-tuning-tips.md index 2188e9064..7e0478b4a 100644 --- a/versioned_docs/version-1.3/user-guide/deployments-administration/performance-tuning/performance-tuning-tips.md +++ b/versioned_docs/version-1.3/user-guide/deployments-administration/performance-tuning/performance-tuning-tips.md @@ -56,11 +56,14 @@ The following metrics help diagnose query performance issues: | Metric | Type | Description | |---|---|---| | greptime_mito_read_stage_elapsed_bucket | histogram | The elapsed time of different phases of a query in the storage engine. | +| greptime_mito_scan_max_concurrent_files | histogram | Planned maximum concurrent files (including memtable sources for queries) per region scan limit evaluation or compaction reader, labeled by `type` (`query` or `compaction`). Reflects planned scan concurrency rather than live open files. See [Scan memory accounting](/user-guide/deployments-administration/configuration.md#scan-memory-accounting). | | greptime_mito_cache_bytes | gauge | Size of cached contents. The `type` label indicates the cache type. | | greptime_mito_cache_hit | counter | Total count of cache hit. The `type` label indicates the cache type. | | greptime_mito_cache_miss | counter | Total count of cache miss. The `type` label indicates the cache type. | | greptime_mito_cache_eviction | counter | Total count of cache eviction. The `type` label indicates the cache type. | +If `greptime_mito_scan_max_concurrent_files` with `type="query"` shows many scan evaluations exceeding 100 concurrent files, your tables may have too many small SST files. Inspect [`INFORMATION_SCHEMA.SSTS_MANIFEST`](/reference/sql/information-schema/ssts-manifest.md) and see [Queries fail with `Too many files to read concurrently`](/faq-and-others/faq.md#queries-fail-with-too-many-files-to-read-concurrently-what-should-i-do) for diagnosis and compaction steps. + ### Enlarging cache size