From f141074c25d9fac30a31748b947c77dc20356d08 Mon Sep 17 00:00:00 2001 From: weekface Date: Tue, 25 Dec 2018 20:30:38 +0800 Subject: [PATCH 1/3] add block-cache-size to values.yaml --- charts/tidb-cluster/templates/config/_tikv-config.tpl | 8 ++++++++ charts/tidb-cluster/values.yaml | 6 ++++++ 2 files changed, 14 insertions(+) diff --git a/charts/tidb-cluster/templates/config/_tikv-config.tpl b/charts/tidb-cluster/templates/config/_tikv-config.tpl index a2336bd11cb..2a081063ba2 100644 --- a/charts/tidb-cluster/templates/config/_tikv-config.tpl +++ b/charts/tidb-cluster/templates/config/_tikv-config.tpl @@ -403,7 +403,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 @@ -437,7 +441,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 diff --git a/charts/tidb-cluster/values.yaml b/charts/tidb-cluster/values.yaml index e631c205b9d..17be25862a8 100644 --- a/charts/tidb-cluster/values.yaml +++ b/charts/tidb-cluster/values.yaml @@ -103,6 +103,12 @@ 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" + tikvPromGateway: image: prom/pushgateway:v0.3.1 imagePullPolicy: IfNotPresent From 1e34a20dfdfa7702c5d883d1c20578db13de7430 Mon Sep 17 00:00:00 2001 From: weekface Date: Wed, 26 Dec 2018 12:32:26 +0800 Subject: [PATCH 2/3] address comment --- .../templates/config/_tikv-config.tpl | 19 +++++++++++++++++++ charts/tidb-cluster/values.yaml | 12 ++++++++++++ 2 files changed, 31 insertions(+) diff --git a/charts/tidb-cluster/templates/config/_tikv-config.tpl b/charts/tidb-cluster/templates/config/_tikv-config.tpl index 2a081063ba2..b70b03024f7 100644 --- a/charts/tidb-cluster/templates/config/_tikv-config.tpl +++ b/charts/tidb-cluster/templates/config/_tikv-config.tpl @@ -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 @@ -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 @@ -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. diff --git a/charts/tidb-cluster/values.yaml b/charts/tidb-cluster/values.yaml index 17be25862a8..69c7dd893de 100644 --- a/charts/tidb-cluster/values.yaml +++ b/charts/tidb-cluster/values.yaml @@ -106,9 +106,21 @@ tikv: # 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 From a3baabc8e457239bebaf76377933e6fa35e198f6 Mon Sep 17 00:00:00 2001 From: weekface Date: Wed, 26 Dec 2018 14:46:29 +0800 Subject: [PATCH 3/3] address comment --- .../templates/config/_tikv-config.tpl | 16 ++++++++-------- charts/tidb-cluster/values.yaml | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/charts/tidb-cluster/templates/config/_tikv-config.tpl b/charts/tidb-cluster/templates/config/_tikv-config.tpl index b70b03024f7..6cddc4c2565 100644 --- a/charts/tidb-cluster/templates/config/_tikv-config.tpl +++ b/charts/tidb-cluster/templates/config/_tikv-config.tpl @@ -18,13 +18,13 @@ log-level = {{ .Values.tikv.logLevel | default "info" | quote }} # log-rotation-timespan = "24h" [readpool.storage] -{{- if .Values.tikv.readpoolStorageconcurrency }} +{{- if .Values.tikv.readpoolStorageConcurrency }} # size of thread pool for high-priority operations -high-concurrency = {{ .Values.tikv.readpoolStorageconcurrency }} +high-concurrency = {{ .Values.tikv.readpoolStorageConcurrency }} # size of thread pool for normal-priority operations -normal-concurrency = {{ .Values.tikv.readpoolStorageconcurrency }} +normal-concurrency = {{ .Values.tikv.readpoolStorageConcurrency }} # size of thread pool for low-priority operations -low-concurrency = {{ .Values.tikv.readpoolStorageconcurrency }} +low-concurrency = {{ .Values.tikv.readpoolStorageConcurrency }} {{- else }} # size of thread pool for high-priority operations # high-concurrency = 4 @@ -46,10 +46,10 @@ low-concurrency = {{ .Values.tikv.readpoolStorageconcurrency }} # 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 }} +{{- 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 diff --git a/charts/tidb-cluster/values.yaml b/charts/tidb-cluster/values.yaml index 69c7dd893de..43bc5823e62 100644 --- a/charts/tidb-cluster/values.yaml +++ b/charts/tidb-cluster/values.yaml @@ -111,11 +111,11 @@ tikv: # writecfBlockCacheSize: "256MB" # size of thread pool for high-priority/normal-priority/low-priority operations - # readpoolStorageconcurrency: 4 + # 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 + # readpoolCoprocessorConcurrency: 8 # scheduler's worker pool size, should increase it in heavy write cases, # also should less than total cpu cores.