diff --git a/deploy/base/server.yaml b/deploy/base/server.yaml index 0f76b3fb..df54842d 100644 --- a/deploy/base/server.yaml +++ b/deploy/base/server.yaml @@ -90,9 +90,9 @@ spec: name: clickhouse-credentials key: CLICKHOUSE_PASSWORD - name: CAMELEER_STORAGE_METRICS - value: "postgres" + value: "clickhouse" - name: CAMELEER_STORAGE_SEARCH - value: "opensearch" + value: "clickhouse" - name: CAMELEER_STORAGE_STATS value: "clickhouse" diff --git a/deploy/clickhouse.yaml b/deploy/clickhouse.yaml index 4e1e3841..1e7415ec 100644 --- a/deploy/clickhouse.yaml +++ b/deploy/clickhouse.yaml @@ -41,15 +41,19 @@ spec: - name: initdb mountPath: /docker-entrypoint-initdb.d - name: config - mountPath: /etc/clickhouse-server/config.d/memory-tuning.xml - subPath: memory-tuning.xml + mountPath: /etc/clickhouse-server/config.d/low-memory.xml + subPath: low-memory.xml + readOnly: true + - name: config + mountPath: /etc/clickhouse-server/users.d/low-memory-users.xml + subPath: low-memory-users.xml readOnly: true resources: requests: memory: "2Gi" cpu: "500m" limits: - memory: "6Gi" + memory: "4Gi" cpu: "2000m" livenessProbe: httpGet: @@ -106,28 +110,81 @@ metadata: name: clickhouse-config namespace: cameleer data: - memory-tuning.xml: | + # Server-level tuning for 4Gi container. + # Based on https://kb.altinity.com/altinity-kb-setup-and-maintenance/configure_clickhouse_for_low_mem_envs/ + low-memory.xml: | - - - + + false - + + + + + + + + + + + 0.75 + 0 + + + 268435456 + 67108864 + 16777216 + 67108864 + + + 2000 + 64 + 8 + + + 2 + 2 + 1 + 1 + 1 + 2 + 8 + 1 + 1 + 0 + 0 + + + + 1024 + 1073741824 + 134217728 + 134217728 + 2 + 2 + 2 + + + # User profile settings — per-query limits and parallelism. + low-memory-users.xml: | + - 2147483648 + + 2 + + 1610612736 + 8192 + 1000 + 600 + + 0 + 0 + + 1073741824 + 1073741824 - - - 134217728 - 67108864 - 0 - 67108864 - - - 536870912 - --- apiVersion: v1