Skip to content

Commit 8859067

Browse files
committed
chore(clustered): Gather system information for reporting query performance issues.
1 parent 24064ce commit 8859067

File tree

2 files changed

+88
-4
lines changed

2 files changed

+88
-4
lines changed

content/influxdb/clustered/query-data/troubleshoot-and-optimize/optimize-queries.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,3 +91,6 @@ less efficient.
9191

9292
Learn how to [analyze a query plan](/influxdb/clustered/query-data/troubleshoot-and-optimize/analyze-query-plan/)
9393
to troubleshoot queries and find performance bottlenecks.
94+
95+
If you need help troubleshooting, follow the guidelines to
96+
[report query performance issues](/influxdb/clustered/query-data/troubleshoot-and-optimize/report-query-performance-issues/).

content/influxdb/clustered/query-data/troubleshoot-and-optimize/report-query-performance-issues.md

Lines changed: 85 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ menu:
77
name: Report query performance issues
88
parent: Troubleshoot and optimize queries
99
weight: 402
10+
related:
11+
- /influxdb/clustered/admin/query-system-data/
1012
---
1113

1214
These guidelines are intended to faciliate collaboration between InfluxData
@@ -23,13 +25,17 @@ queries](/influxdb/clustered/query-data//troubleshoot-and-optimize).
2325
6. [Reduce query noise](#reduce-query-noise)
2426
7. [Establish baseline single-query performance](#establish-baseline-single-query-performance)
2527
8. [Run queries at multiple load scales](#run-queries-at-multiple-load-scales)
26-
9. [Gather debug info](#gather-debug-info)
28+
9. [Gather debug information](#gather-debug-information)
2729
1. [Kubernetes-specific information](#kubernetes-specific-information)
2830
2. [Clustered-specific information](#clustered-specific-information)
2931
3. [Query analysis](#query-analysis)
3032
1. [EXPLAIN](#explain)
3133
2. [EXPLAIN VERBOSE](#explain-verbose)
3234
3. [EXPLAIN ANALYZE](#explain-analyze)
35+
10. [Gather system information](#gather-system-information)
36+
- [Collect table information](#collect-table-information)
37+
- [Collect compaction information for the table](#collect-compaction-information-for-the-table)
38+
- [Collect partition information for multiple tables](#collect-partition-information-for-multiple-tables)
3339

3440
{{% note %}}
3541
Please note that this document may change from one support engagement to the
@@ -141,14 +147,21 @@ As an example, consider the following test plan outline:
141147
4. Run 10 concurrent instances of Query A and allow the cluster to recover for 1 minute.
142148
5. Run 20 concurrent instances of Query A and allow the cluster to recover for 1 minute.
143149
6. Run 40 concurrent instances of Query A and allow the cluster to recover for 1 minute.
144-
7. Provide InfluxData the debug information [described below](#gather-debug-info).
150+
7. Provide InfluxData the debug information [described below](#gather-debug-information).
145151

146152
{{% note %}}
147153
This is just an example. You don't have to go beyond the scale where queries get slower
148154
but you may also need to go further than what's outlined here.
149155
{{% /note %}}
150156

151-
### Gather debug info
157+
### Capture dashboard screens
158+
159+
If you have set up alerts and dashboards for monitoring your cluster, capture
160+
screenshots of dashboard events for Queriers, Compactors, and Ingesters.
161+
162+
See [system query examples](/influxdb/clustered/admin/query-system-data/#system-query-examples).
163+
164+
### Gather debug information
152165

153166
The following debug information should be collected shortly _after_ a
154167
problematic query has been tried against your InfluxDB cluster.
@@ -165,7 +178,7 @@ kubectl cluster-info dump --namespace influxdb --output-directory "${DATETIME}-c
165178
tar -czf "${DATETIME}-cluster-info.tar.gz" "${DATETIME}-cluster-info/"
166179
```
167180

168-
#### Clustered-Specific Info
181+
#### Clustered-specific information
169182

170183
**Outputs:**
171184

@@ -310,3 +323,71 @@ curl --get "https://{{< influxdb/host >}}/query" \
310323
{{< /code-tabs-wrapper >}}
311324

312325
{{% /code-placeholders %}}
326+
327+
### Gather system information
328+
329+
{{% warn %}}
330+
#### May impact cluster performance
331+
332+
Querying InfluxDB v3 system tables may impact write and query
333+
performance of your {{< product-name omit=" Clustered" >}} cluster.
334+
Use filters to [optimize queries to reduce impact to your cluster](/influxdb/clustered/admin/query-system-data/#optimize-queries-to-reduce-impact-to-your-cluster).
335+
336+
<!--------------- UPDATE THE DATE BELOW AS EXAMPLES ARE UPDATED --------------->
337+
338+
#### System tables are subject to change
339+
340+
System tables are not part of InfluxDB's stable API and may change with new releases.
341+
The provided schema information and query examples are valid as of **September 20, 2024**.
342+
If you detect a schema change or a non-functioning query example, please
343+
[submit an issue](https://github.com/influxdata/docs-v2/issues/new/choose).
344+
345+
<!--------------- UPDATE THE DATE ABOVE AS EXAMPLES ARE UPDATED --------------->
346+
{{% /warn %}}
347+
348+
If queries are slow for a specific table, run the following system queries to collect information for troubleshooting.
349+
350+
- [Collect table information](#collect-table-information)
351+
- [Collect compaction information for the table](#collect-compaction-information-for-the-table)
352+
- [Collect partition information for multiple tables](#collect-partition-information-for-multiple-tables)
353+
354+
In your queries, replace the following:
355+
356+
- {{% code-placeholder-key %}}`TABLE_NAME`{{% /code-placeholder-key %}}: the
357+
table to retrieve information about
358+
359+
#### Collect table information
360+
361+
{{% code-placeholders "TABLE_NAME" %}}
362+
```sql
363+
SELECT *
364+
FROM system.tables
365+
WHERE table_name = 'TABLE_NAME';
366+
```
367+
{{% /code-placeholders%}}
368+
369+
#### Collect compaction information for the table
370+
371+
{{% code-placeholders "TABLE_NAME" %}}
372+
```sql
373+
SELECT *
374+
FROM system.compactor
375+
WHERE table_name = 'TABLE_NAME';
376+
```
377+
{{% /code-placeholders%}}
378+
379+
#### Collect partition information for multiple tables
380+
381+
If the same queries are slow on more than 1 table, also run the following query to collect the size and
382+
number of partitions for all tables:
383+
384+
{{% code-placeholders "TABLE_NAME" %}}
385+
```sql
386+
SELECT table_name,
387+
COUNT(*) as partition_count,
388+
MAX(last_new_file_created_at) as last_new_file_created_at,
389+
SUM(total_size_mb) as total_size_mb
390+
FROM system.partitions
391+
GROUP BY table_name;
392+
```
393+
{{% /code-placeholders%}}

0 commit comments

Comments
 (0)