Skip to content

reference: add documents about Coprocessor cache#2857

Merged
TomShawn merged 13 commits into
masterfrom
wenxuan/copr-cache
May 14, 2020
Merged

reference: add documents about Coprocessor cache#2857
TomShawn merged 13 commits into
masterfrom
wenxuan/copr-cache

Conversation

@breezewish
Copy link
Copy Markdown
Member

Signed-off-by: Breezewish me@breeswish.org

What is changed, added or deleted? (Required)

This PR adds a document about the Coprocessor cache, as well as its configurations.

Which TiDB version(s) do your changes apply to? (Required)

  • master (the latest development version)
  • v4.0 (TiDB 4.0 versions)
  • v3.1 (TiDB 3.1 versions)
  • v3.0 (TiDB 3.0 versions)
  • v2.1 (TiDB 2.1 versions)

What is the related PR or file link(s)?

This PR includes a new feature proposed by tikv/rfcs#48

Signed-off-by: Breezewish <me@breeswish.org>
@TomShawn TomShawn added translation/doing This PR’s assignee is translating this PR. v4.0 This PR/issue applies to TiDB v4.0. size/large Changes of a large size. labels Apr 22, 2020
@TomShawn TomShawn self-assigned this Apr 22, 2020
@TomShawn
Copy link
Copy Markdown
Contributor

@breeswish Please involve a technical review.

@TomShawn TomShawn changed the title Add documents about Coprocessor cache reference: add documents about Coprocessor cache Apr 22, 2020
@TomShawn TomShawn added the status/PTAL This PR is ready for reviewing. label Apr 27, 2020
# reuses the result when corresponding data in TiKV is unchanged, on a region basis.
enabled = true

# The capacity in MB of the cache.
Copy link
Copy Markdown
Contributor

@innerr innerr Apr 27, 2020

Choose a reason for hiding this comment

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

capacity => memory capacity?

# The capacity in MB of the cache.
capacity-mb = 1000.0

# Only cache requests whose result set is small.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Only .. => Bigger than .... will not be cached
Is it better?


调整该值为一个更大的值可以缓存更多种类下推请求,但也将导致缓存空间更容易被占满。注意,每个下推计算结果集大小一般都会小于 Region 大小,因此将该值设置得远超过 Region 大小没有意义。

- `admission-min-process-ms`: 最小缓存的下推计算结果集计算时间,单位是 ms。若下推计算的计算时间小于该参数指定的时间,则结果集不会被缓存。
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

需要说明这个计算时间是在 tidb 端计算的总耗时,还是 tikv cop 内的耗时吗


参数说明:

- `capacity-mb`: 缓存的总数据量大小,单位是 MB。当缓存空间满时,旧缓存条目将被逐出。
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

淘汰算法是 LRU 吧,需要说明吗


- SQL 语句包含多个变化的条件,其他部分一致,变化的条件完全匹配一个复合索引列。

该场景下部分下部分下推结算的请求会与之前出现过的一致,部分请求能利用上下推计算结果缓存。
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

下部分下部分 typo


该场景下部分下部分下推结算的请求会与之前出现过的一致,部分请求能利用上下推计算结果缓存。

## 观察缓存命中情况
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

改为 缓存效果检验 会不会更好

@TomShawn TomShawn added status/require-change Needs the author to address comments. and removed status/PTAL This PR is ready for reviewing. labels Apr 27, 2020
Signed-off-by: Breezewish <me@breeswish.org>
Copy link
Copy Markdown
Contributor

@innerr innerr left a comment

Choose a reason for hiding this comment

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

LGTM

Comment thread reference/configuration/tidb-server/configuration-file.md
Comment thread reference/configuration/tidb-server/configuration-file.md Outdated
Comment thread reference/configuration/tidb-server/configuration-file.md Outdated
Comment thread reference/performance/coprocessor-cache.md Outdated
Comment thread reference/performance/coprocessor-cache.md Outdated
Comment thread reference/performance/coprocessor-cache.md Outdated
Comment thread reference/performance/coprocessor-cache.md Outdated
Comment thread reference/performance/coprocessor-cache.md Outdated
Comment thread reference/performance/coprocessor-cache.md Outdated
Comment thread reference/performance/coprocessor-cache.md Outdated
@sre-bot
Copy link
Copy Markdown
Contributor

sre-bot commented Apr 29, 2020

@breeswish, please update your pull request.

@sre-bot
Copy link
Copy Markdown
Contributor

sre-bot commented Apr 29, 2020

@innerr, @TomShawn, PTAL.

@sre-bot
Copy link
Copy Markdown
Contributor

sre-bot commented May 1, 2020

@breeswish, please update your pull request.

@sre-bot
Copy link
Copy Markdown
Contributor

sre-bot commented May 1, 2020

@innerr, @TomShawn, PTAL.

@sre-bot
Copy link
Copy Markdown
Contributor

sre-bot commented May 4, 2020

@breeswish, please update your pull request.

@sre-bot
Copy link
Copy Markdown
Contributor

sre-bot commented May 4, 2020

No updates for a long time, close PR.

@sre-bot
Copy link
Copy Markdown
Contributor

sre-bot commented May 4, 2020

@innerr, @TomShawn, PTAL.

@innerr
Copy link
Copy Markdown
Contributor

innerr commented May 6, 2020

Any addressing need to update? @breeswish

breezewish and others added 2 commits May 11, 2020 10:53
Co-authored-by: TomShawn <41534398+TomShawn@users.noreply.github.com>
Signed-off-by: Breezewish <me@breeswish.org>

## 特性说明

+ 所有 SQL 在单个 TiDB 上的首次执行都不会被缓存。
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

是 TiDB 实例吗?

@sre-bot
Copy link
Copy Markdown
Contributor

sre-bot commented May 14, 2020

@innerr, @TomShawn, PTAL.

Copy link
Copy Markdown
Contributor

@yikeke yikeke left a comment

Choose a reason for hiding this comment

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

fix ci

Comment thread coprocessor-cache.md Outdated
Comment thread tidb-configuration-file.md Outdated
Copy link
Copy Markdown
Contributor

@TomShawn TomShawn left a comment

Choose a reason for hiding this comment

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

LGTM

@TomShawn TomShawn removed the status/require-change Needs the author to address comments. label May 14, 2020
@TomShawn TomShawn merged commit 2e294be into master May 14, 2020
sre-bot pushed a commit to sre-bot/docs-cn that referenced this pull request May 14, 2020
* Add copr cache documents

Signed-off-by: Breezewish <me@breeswish.org>

* Address comments

Signed-off-by: Breezewish <me@breeswish.org>

* Apply suggestions from code review

Co-authored-by: TomShawn <41534398+TomShawn@users.noreply.github.com>

* Address come comments

Signed-off-by: Breezewish <me@breeswish.org>

* refine format

* Update coprocessor-cache.md

* relocate the file

* Apply suggestions from code review

* add toc

* Update coprocessor-cache.md

* Update TOC.md

Co-authored-by: TomShawn <41534398+TomShawn@users.noreply.github.com>
Co-authored-by: yikeke <yikeke@pingcap.com>
Co-authored-by: Keke Yi <40977455+yikeke@users.noreply.github.com>
@sre-bot
Copy link
Copy Markdown
Contributor

sre-bot commented May 14, 2020

cherry pick to release-4.0 in PR #3108

TomShawn added a commit that referenced this pull request May 14, 2020
* Add copr cache documents

Signed-off-by: Breezewish <me@breeswish.org>

* Address comments

Signed-off-by: Breezewish <me@breeswish.org>

* Apply suggestions from code review

Co-authored-by: TomShawn <41534398+TomShawn@users.noreply.github.com>

* Address come comments

Signed-off-by: Breezewish <me@breeswish.org>

* refine format

* Update coprocessor-cache.md

* relocate the file

* Apply suggestions from code review

* add toc

* Update coprocessor-cache.md

* Update TOC.md

Co-authored-by: TomShawn <41534398+TomShawn@users.noreply.github.com>
Co-authored-by: yikeke <yikeke@pingcap.com>
Co-authored-by: Keke Yi <40977455+yikeke@users.noreply.github.com>

Co-authored-by: Wenxuan <hi@breeswish.org>
Co-authored-by: TomShawn <41534398+TomShawn@users.noreply.github.com>
Co-authored-by: yikeke <yikeke@pingcap.com>
Co-authored-by: Keke Yi <40977455+yikeke@users.noreply.github.com>
@breezewish breezewish deleted the wenxuan/copr-cache branch May 14, 2020 13:52
@TomShawn TomShawn added translation/done This PR has been translated from English into Chinese and updated to pingcap/docs-cn in a PR. and removed translation/doing This PR’s assignee is translating this PR. labels May 25, 2020
@TomShawn TomShawn mentioned this pull request Jun 2, 2020
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/large Changes of a large size. translation/done This PR has been translated from English into Chinese and updated to pingcap/docs-cn in a PR. v4.0 This PR/issue applies to TiDB v4.0.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants