Skip to content

Commit

Permalink
add block-cache-size to values.yaml (#252)
Browse files Browse the repository at this point in the history
Expose CPU & memory related TiKV configurations to values.yaml
  • Loading branch information
weekface authored and tennix committed Dec 27, 2018
1 parent 843152c commit 4b469da
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
27 changes: 27 additions & 0 deletions charts/tidb-cluster/templates/config/_tikv-config.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,21 @@ log-level = {{ .Values.tikv.logLevel | default "info" | quote }}
# log-rotation-timespan = "24h"

[readpool.storage]
{{- if .Values.tikv.readpoolStorageConcurrency }}
# size of thread pool for high-priority operations
high-concurrency = {{ .Values.tikv.readpoolStorageConcurrency }}
# size of thread pool for normal-priority operations
normal-concurrency = {{ .Values.tikv.readpoolStorageConcurrency }}
# size of thread pool for low-priority operations
low-concurrency = {{ .Values.tikv.readpoolStorageConcurrency }}
{{- else }}
# size of thread pool for high-priority operations
# high-concurrency = 4
# size of thread pool for normal-priority operations
# normal-concurrency = 4
# size of thread pool for low-priority operations
# low-concurrency = 4
{{- end }}
# max running high-priority operations of each worker, reject if exceed
# max-tasks-per-worker-high = 2000
# max running normal-priority operations of each worker, reject if exceed
Expand All @@ -37,9 +46,15 @@ log-level = {{ .Values.tikv.logLevel | default "info" | quote }}
# Notice: if CPU_NUM > 8, default thread pool size for coprocessors
# will be set to CPU_NUM * 0.8.

{{- if .Values.tikv.readpoolCoprocessorConcurrency }}
high-concurrency = {{ .Values.tikv.readpoolCoprocessorConcurrency }}
normal-concurrency = {{ .Values.tikv.readpoolCoprocessorConcurrency }}
low-concurrency = {{ .Values.tikv.readpoolCoprocessorConcurrency }}
{{- else }}
# high-concurrency = 8
# normal-concurrency = 8
# low-concurrency = 8
{{- end }}
# max-tasks-per-worker-high = 2000
# max-tasks-per-worker-normal = 2000
# max-tasks-per-worker-low = 2000
Expand Down Expand Up @@ -105,7 +120,11 @@ log-level = {{ .Values.tikv.logLevel | default "info" | quote }}

# scheduler's worker pool size, should increase it in heavy write cases,
# also should less than total cpu cores.
{{- if .Values.tikv.storageSchedulerWorkerPoolSize }}
scheduler-worker-pool-size = {{ .Values.tikv.storageSchedulerWorkerPoolSize }}
{{- else }}
# scheduler-worker-pool-size = 4
{{- end }}

# When the pending write bytes exceeds this threshold,
# the "scheduler too busy" error is displayed.
Expand Down Expand Up @@ -403,7 +422,11 @@ sync-log = {{ .Values.tikv.syncLog }}

# block-cache used to cache uncompressed blocks, big block-cache can speed up read.
# in normal cases should tune to 30%-50% system's total memory.
{{- if .Values.tikv.defaultcfBlockCacheSize }}
block-cache-size = {{ .Values.tikv.defaultcfBlockCacheSize | quote }}
{{- else }}
# block-cache-size = "1GB"
{{- end }}

# Indicating if we'd put index/filter blocks to the block cache.
# If not specified, each "table reader" object will pre-load index/filter block
Expand Down Expand Up @@ -437,7 +460,11 @@ sync-log = {{ .Values.tikv.syncLog }}
# target-file-size-base = "8MB"

# in normal cases should tune to 10%-30% system's total memory.
{{- if .Values.tikv.writecfBlockCacheSize }}
block-cache-size = {{ .Values.tikv.writecfBlockCacheSize | quote }}
{{- else }}
# block-cache-size = "256MB"
{{- end }}
# level0-file-num-compaction-trigger = 4
# level0-slowdown-writes-trigger = 20
# level0-stop-writes-trigger = 36
Expand Down
18 changes: 18 additions & 0 deletions charts/tidb-cluster/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,24 @@ tikv:
# value: tidb
# effect: "NoSchedule"

# block-cache used to cache uncompressed blocks, big block-cache can speed up read.
# in normal cases should tune to 30%-50% tikv.resources.limits.memory
# defaultcfBlockCacheSize: "1GB"

# in normal cases should tune to 10%-30% tikv.resources.limits.memory
# writecfBlockCacheSize: "256MB"

# size of thread pool for high-priority/normal-priority/low-priority operations
# readpoolStorageConcurrency: 4

# Notice: if tikv.resources.limits.cpu > 8, default thread pool size for coprocessors
# will be set to tikv.resources.limits.cpu * 0.8.
# readpoolCoprocessorConcurrency: 8

# scheduler's worker pool size, should increase it in heavy write cases,
# also should less than total cpu cores.
# storageSchedulerWorkerPoolSize: 4

tikvPromGateway:
image: prom/pushgateway:v0.3.1
imagePullPolicy: IfNotPresent
Expand Down

0 comments on commit 4b469da

Please sign in to comment.