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

config, sysvar: update descriptions about instance sysvars #10978

Merged
merged 52 commits into from
Nov 1, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
982ea2b
config, sysvar: update descriptions about instance sysvars
CbcWestwolf Aug 18, 2022
7fdf9d4
Fix
CbcWestwolf Aug 18, 2022
88db956
force-priority
CbcWestwolf Aug 19, 2022
a24d0b3
Merge branch 'master' into pr/10978
TomShawn Sep 6, 2022
142da6b
Merge branch 'master' of github.com:pingcap/docs-cn into fix_configs_…
CbcWestwolf Oct 6, 2022
e534a5c
Update
CbcWestwolf Oct 6, 2022
e447d3b
Fix
CbcWestwolf Oct 6, 2022
dbd054e
Update
CbcWestwolf Oct 6, 2022
5bff2de
Merge branch 'master' of github.com:pingcap/docs-cn into fix_configs_…
CbcWestwolf Oct 8, 2022
7f8e5df
Merge branch 'master' of github.com:pingcap/docs-cn into fix_configs_…
CbcWestwolf Oct 10, 2022
0ed4864
Update dashboard/dashboard-slow-query.md
CbcWestwolf Oct 10, 2022
ffcda55
Update tidb-configuration-file.md
CbcWestwolf Oct 10, 2022
e9a322c
Update tidb-configuration-file.md
CbcWestwolf Oct 10, 2022
b331a8a
Merge branch 'fix_configs_sysvars' of github.com:CbcWestwolf/docs-cn …
CbcWestwolf Oct 10, 2022
01e0d08
Remove version info
CbcWestwolf Oct 10, 2022
de2638c
Add description about inheriting config
CbcWestwolf Oct 10, 2022
70a3a2f
Update dashboard/dashboard-slow-query.md
CbcWestwolf Oct 17, 2022
2024532
Update faq/manage-cluster-faq.md
CbcWestwolf Oct 17, 2022
6a38e5e
Update identify-slow-queries.md
CbcWestwolf Oct 17, 2022
40321f5
Update identify-slow-queries.md
CbcWestwolf Oct 17, 2022
b2c856d
Update tidb-configuration-file.md
CbcWestwolf Oct 17, 2022
2b5f0ff
Update tidb-configuration-file.md
CbcWestwolf Oct 17, 2022
fbf2d0e
Update tidb-configuration-file.md
CbcWestwolf Oct 17, 2022
b4e1b40
Update tidb-configuration-file.md
CbcWestwolf Oct 17, 2022
7e7df69
Update tidb-configuration-file.md
CbcWestwolf Oct 17, 2022
616bf63
Update tidb-configuration-file.md
CbcWestwolf Oct 17, 2022
4ba36ce
Update tidb-configuration-file.md
CbcWestwolf Oct 17, 2022
8b723ac
Add deprecated config items
CbcWestwolf Oct 17, 2022
bcf941b
Update
CbcWestwolf Oct 18, 2022
ff94987
Merge branch 'master' of github.com:pingcap/docs-cn into fix_configs_…
CbcWestwolf Oct 18, 2022
d489d94
Update
CbcWestwolf Oct 18, 2022
b080c12
Update system-variables.md
CbcWestwolf Oct 18, 2022
1c34835
Update tidb-configuration-file.md
CbcWestwolf Oct 18, 2022
6909c80
Update tidb-configuration-file.md
CbcWestwolf Oct 18, 2022
fbcdd97
Update tidb-configuration-file.md
CbcWestwolf Oct 18, 2022
0b9ea82
Update tidb-configuration-file.md
CbcWestwolf Oct 18, 2022
1c6f562
Update tidb-configuration-file.md
CbcWestwolf Oct 18, 2022
90362e0
Update tidb-configuration-file.md
CbcWestwolf Oct 18, 2022
1eac4e8
Update tidb-configuration-file.md
CbcWestwolf Oct 18, 2022
e9198b6
Update tidb-configuration-file.md
CbcWestwolf Oct 18, 2022
4d0e2cc
Remote "出于兼容性考虑"
CbcWestwolf Oct 18, 2022
4c837ef
Update tidb-configuration-file.md
CbcWestwolf Oct 18, 2022
821996e
Apply suggestions from code review
CbcWestwolf Oct 18, 2022
f39f024
Update tidb-configuration-file.md
TomShawn Oct 19, 2022
f1d685d
Apply suggestions from code review
CbcWestwolf Oct 19, 2022
eb2a0fd
Update
CbcWestwolf Oct 19, 2022
621fa52
Update
CbcWestwolf Oct 20, 2022
5e03a8c
right order
TomShawn Oct 20, 2022
cf6953c
Update system-variables.md
CbcWestwolf Oct 20, 2022
47a09da
Update tidb-configuration-file.md
CbcWestwolf Oct 20, 2022
7875606
Update tidb-configuration-file.md
CbcWestwolf Oct 20, 2022
50d3e43
Apply suggestions from code review
CbcWestwolf Oct 31, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix
  • Loading branch information
CbcWestwolf committed Aug 18, 2022
commit 7fdf9d49a8e8e872a65ba6a9327f183282421b1f
2 changes: 1 addition & 1 deletion configure-memory-usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ server-memory-quota = 34359738368

TiDB 支持对执行算子的数据落盘功能。当 SQL 的内存使用超过 Memory Quota 时,tidb-server 可以通过落盘执行算子的中间数据,缓解内存压力。支持落盘的算子有:Sort、MergeJoin、HashJoin、HashAgg。

- 落盘行为由参数 [`tidb_mem_quota_query`](/system-variables.md#tidb_mem_quota_query)、[`tidb_enable_tmp_storage_on_oom`](/system-variables.md#tidb_enable_tmp_storage_on_oom)、[`tmp-storage-path`](/tidb-configuration-file.md#tmp-storage-path)、[`tmp-storage-quota`](/tidb-configuration-file.md#tmp-storage-quota) 共同控制。
- 落盘行为由参数 [`tidb_mem_quota_query`](/system-variables.md#tidb_mem_quota_query)、[`tidb_enable_tmp_storage_on_oom`](/system-variables.md#tidb_enable_tmp_storage_on_oom-从-v630-版本开始引入)、[`tmp-storage-path`](/tidb-configuration-file.md#tmp-storage-path)、[`tmp-storage-quota`](/tidb-configuration-file.md#tmp-storage-quota) 共同控制。
- 当落盘被触发时,TiDB 会在日志中打印一条包含关键字 `memory exceeds quota, spill to disk now` 或 `memory exceeds quota, set aggregate mode to spill-mode` 的日志。
- Sort、MergeJoin、HashJoin 落盘是从 v4.0.0 版本开始引入的,HashAgg 落盘是从 v5.2.0 版本开始引入的。
- 当包含 Sort、MergeJoin 或 HashJoin 的 SQL 语句引起内存 OOM 时,TiDB 默认会触发落盘。当包含 HashAgg 算子的 SQL 语句引起内存 OOM 时,TiDB 默认不触发落盘,请设置系统变量 `tidb_executor_concurrency = 1` 来触发 HashAgg 落盘功能。
Expand Down
2 changes: 1 addition & 1 deletion enable-disk-spill-encrypt.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ summary: 了解如何为 TiDB 落盘文件开启加密。

# 为 TiDB 落盘文件开启加密

当配置项 [`tidb_enable_tmp_storage_on_oom`](/system-variables.md#tidb_enable_tmp_storage_on_oom) 为 `true` 时,如果单条 SQL 语句的内存使用超出系统变量 [`tidb_mem_quota_query`](/system-variables.md#tidb_mem_quota_query) 的限制,某些算子可以将执行时的中间结果作为临时文件落盘保存,直到查询执行完成之后将它们删除。
当配置项 [`tidb_enable_tmp_storage_on_oom`](/system-variables.md#tidb_enable_tmp_storage_on_oom-从-v630-版本开始引入) 为 `true` 时,如果单条 SQL 语句的内存使用超出系统变量 [`tidb_mem_quota_query`](/system-variables.md#tidb_mem_quota_query) 的限制,某些算子可以将执行时的中间结果作为临时文件落盘保存,直到查询执行完成之后将它们删除。

用户可以开启落盘文件加密功能,防止攻击者通过读取临时文件来访问数据。

Expand Down
2 changes: 1 addition & 1 deletion explain-joins.md
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ TiDB 会按照以下顺序执行 `HashJoin_27` 算子:

### 运行数据

如果在执行操作时,内存使用超过了 [`tidb_mem_quota_query`](/system-variables.md#tidb_mem_quota_query) 规定的值(默认为 1GB),且 [`tidb_enable_tmp_storage_on_oom`](/system-variables.md#tidb_enable_tmp_storage_on_oom) 的值为 `ON` (默认为 `ON`),那么 TiDB 会尝试使用临时存储,在磁盘上创建 Hash Join 的 Build 端。`EXPLAIN ANALYZE` 返回结果中的 `execution info` 一栏记录了有关内存使用情况等运行数据。下面的例子展示了 `tidb_mem_quota_query` 的值分别设为 1GB(默认)及 500MB 时,`EXPLAIN ANALYZE` 的返回结果(当内存配额设为 500MB 时,磁盘用作临时存储区):
如果在执行操作时,内存使用超过了 [`tidb_mem_quota_query`](/system-variables.md#tidb_mem_quota_query) 规定的值(默认为 1GB),且 [`tidb_enable_tmp_storage_on_oom`](/system-variables.md#tidb_enable_tmp_storage_on_oom-从-v630-版本开始引入) 的值为 `ON` (默认为 `ON`),那么 TiDB 会尝试使用临时存储,在磁盘上创建 Hash Join 的 Build 端。`EXPLAIN ANALYZE` 返回结果中的 `execution info` 一栏记录了有关内存使用情况等运行数据。下面的例子展示了 `tidb_mem_quota_query` 的值分别设为 1GB(默认)及 500MB 时,`EXPLAIN ANALYZE` 的返回结果(当内存配额设为 500MB 时,磁盘用作临时存储区):

```sql
EXPLAIN ANALYZE SELECT /*+ HASH_JOIN(t1, t2) */ * FROM t1, t2 WHERE t1.id = t2.id;
Expand Down
2 changes: 1 addition & 1 deletion faq/sql-faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ TiDB 的 `SHOW PROCESSLIST` 与 MySQL 的 `SHOW PROCESSLIST` 显示内容基本

## 在 TiDB 中如何控制或改变 SQL 提交的执行优先级?

TiDB 支持改变 [per-session](/system-variables.md#tidb_force_priority)、[全局](/tidb-configuration-file.md#force-priority)或单个语句的优先级。优先级包括:
TiDB 支持改变 [per-session](/system-variables.md#tidb_force_priority)、[全局](/system-variables.md#tidb_force_priority)或单个语句的优先级。优先级包括:

- HIGH_PRIORITY:该语句为高优先级语句,TiDB 在执行阶段会优先处理这条语句
- LOW_PRIORITY:该语句为低优先级语句,TiDB 在执行阶段会降低这条语句的优先级
Expand Down
2 changes: 1 addition & 1 deletion system-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -988,7 +988,7 @@ MPP 是 TiFlash 引擎提供的分布式计算框架,允许节点之间的数
- 是否持久化到集群:是
- 默认值:`ON`
- 这个变量控制是否为读数据的算子开启动态内存控制功能。读数据的算子默认启用 [`tidb_distsql_scan_concurrency`](/system-variables.md#tidb_distsql_scan_concurrency) 所允许的最大线程数来读取数据。当单条 SQL 语句的内存使用每超过 [`tidb_mem_quota_query`](/system-variables.md#tidb_mem_quota_query) 一次,读数据的算子会停止一个线程。
- 当读数据的算子只剩 1 个线程且当单条 SQL 语句的内存使用继续超过 [`tidb_mem_quota_query`](/system-variables.md#tidb_mem_quota_query) 时,该 SQL 语句会触发其它的内存控制行为,例如[落盘](/system-variables.md#tidb_enable_tmp_storage_on_oom)。
- 当读数据的算子只剩 1 个线程且当单条 SQL 语句的内存使用继续超过 [`tidb_mem_quota_query`](/system-variables.md#tidb_mem_quota_query) 时,该 SQL 语句会触发其它的内存控制行为,例如[落盘](/system-variables.md#tidb_enable_tmp_storage_on_oom-从-v630-版本开始引入)。

### `tidb_enable_slow_log`

Expand Down
8 changes: 4 additions & 4 deletions tidb-configuration-file.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ TiDB 配置文件比命令行参数支持更多的选项。你可以在 [config/

+ 设置是否在单条 SQL 语句的内存使用超出系统变量 [`tidb_mem_quota_query`](/system-variables.md#tidb_mem_quota_query) 限制时为某些算子启用临时磁盘。
+ 默认值:true
+ 在 v6.3.0 之后(含 v6.3.0)该配置项的功能由系统变量 [`tidb_enable_tmp_storage_on_oom`](/system-variables.md#tidb_enable_tmp_storage_on_oom) 代替,升级到 v6.3.0 时会自动继承原有设置。
+ 在 v6.3.0 之后(含 v6.3.0)该配置项的功能由系统变量 [`tidb_enable_tmp_storage_on_oom`](/system-variables.md#tidb_enable_tmp_storage_on_oom-从-v630-版本开始引入) 代替,升级到 v6.3.0 时会自动继承原有设置。
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

“自动继承原有设置”能再明确下吗?升级后,这个配置项是否还存在,是否还可以用?


### `tmp-storage-path`

+ 单条 SQL 语句的内存使用超出系统变量 [`tidb_mem_quota_query`](/system-variables.md#tidb_mem_quota_query) 限制时,某些算子的临时磁盘存储位置。
+ 默认值:`<操作系统临时文件夹>/<操作系统用户ID>_tidb/MC4wLjAuMDo0MDAwLzAuMC4wLjA6MTAwODA=/tmp-storage`。其中 `MC4wLjAuMDo0MDAwLzAuMC4wLjA6MTAwODA=` 是对 `<host>:<port>/<statusHost>:<statusPort>` 进行 `Base64` 编码的输出结果。
+ 此配置仅在 [`tidb_enable_tmp_storage_on_oom`](/system-variables.md#tidb_enable_tmp_storage_on_oom) 为 true 时有效。
+ 此配置仅在 [`tidb_enable_tmp_storage_on_oom`](/system-variables.md#tidb_enable_tmp_storage_on_oom-从-v630-版本开始引入) 为 true 时有效。
CbcWestwolf marked this conversation as resolved.
Show resolved Hide resolved

### `tmp-storage-quota`

Expand Down Expand Up @@ -701,7 +701,7 @@ PROXY 协议相关的配置项。
+ TiDB 中同时允许的最大客户端连接数,用于资源控制。
+ 默认值:0
hfxsd marked this conversation as resolved.
Show resolved Hide resolved
+ 默认情况下,TiDB 不限制客户端连接数。当本配置项的值大于 `0` 且客户端连接数到达此值时,TiDB 服务端将会拒绝新的客户端连接。
+ 该值作为系统变量 [`max_connections`](/system-variables.md#max_connections) 的初始值。
+ 该值作为系统变量 [`max_connections`](/system-variables.md#max_connections-从-v630-版本开始引入) 的初始值。

### `tidb_memory_usage_alarm_ratio` <span class="version-mark">从 v6.1.0 版本开始引入</span>

Expand All @@ -716,7 +716,7 @@ PROXY 协议相关的配置项。

+ 用于表示该 tidb-server 是否运行 DDL 语句。
+ 默认值:true
+ 该值作为系统变量 [`tidb_enable_ddl`](/system-variables.md#tidb_enable_ddl) 的初始值。
+ 该值作为系统变量 [`tidb_enable_ddl`](/system-variables.md#tidb_enable_ddl-从-v630-版本开始引入) 的初始值。

## experimental

Expand Down