@@ -146,6 +146,8 @@ locals {
146
146
service_account = " uptrace-clickhouse"
147
147
148
148
# https://github.com/bitnami/charts/blob/main/bitnami/clickhouse/values.yaml
149
+ # https://uptrace.dev/get/config.html#s3-storage
150
+ # https://altinity.com/blog/clickhouse-mergetree-on-s3-administrative-best-practices
149
151
clickhouse_values = [
150
152
<<- EOT
151
153
shards: 1
@@ -155,7 +157,7 @@ locals {
155
157
existingSecret: "uptrace-clickhouse-password"
156
158
existingSecretKey: "password"
157
159
persistence:
158
- size: 5Gi
160
+ size: 10Gi
159
161
automountServiceAccountToken: true
160
162
serviceAccount:
161
163
create: true
@@ -181,7 +183,7 @@ locals {
181
183
<cache_enabled>true</cache_enabled>
182
184
<data_cache_enabled>true</data_cache_enabled>
183
185
<enable_filesystem_cache>true</enable_filesystem_cache>
184
- <cache_on_write_operations>true </cache_on_write_operations>
186
+ <cache_on_write_operations>false </cache_on_write_operations>
185
187
<max_cache_size>1Gi</max_cache_size>
186
188
<cache_path>/bitnami/clickhouse/data/disks/s3_default/cache/</cache_path>
187
189
</s3_default>
@@ -194,7 +196,7 @@ locals {
194
196
<cache_enabled>true</cache_enabled>
195
197
<data_cache_enabled>true</data_cache_enabled>
196
198
<enable_filesystem_cache>true</enable_filesystem_cache>
197
- <cache_on_write_operations>true </cache_on_write_operations>
199
+ <cache_on_write_operations>false </cache_on_write_operations>
198
200
<max_cache_size>1Gi</max_cache_size>
199
201
<cache_path>/bitnami/clickhouse/data/disks/s3_metrics/cache/</cache_path>
200
202
</s3_metrics>
@@ -207,47 +209,57 @@ locals {
207
209
<cache_enabled>true</cache_enabled>
208
210
<data_cache_enabled>true</data_cache_enabled>
209
211
<enable_filesystem_cache>true</enable_filesystem_cache>
210
- <cache_on_write_operations>true </cache_on_write_operations>
212
+ <cache_on_write_operations>false </cache_on_write_operations>
211
213
<max_cache_size>1Gi</max_cache_size>
212
214
<cache_path>/bitnami/clickhouse/data/disks/s3_spans/cache/</cache_path>
213
215
</s3_spans>
214
216
</disks>
215
217
<policies>
216
218
<default>
219
+ <!-- items with equal priorities are ordered by their position in config -->
217
220
<volumes>
218
- <volume_s3_default>
221
+ <hot>
222
+ <disk>default</disk>
223
+ </hot>
224
+ <cold>
219
225
<disk>s3_default</disk>
220
- </volume_s3_default>
226
+ <prefer_not_to_merge>true</prefer_not_to_merge>
227
+ <perform_ttl_move_on_insert>0</perform_ttl_move_on_insert>
228
+ </cold>
221
229
</volumes>
230
+ <!-- move data to s3 when disk usage will be more than 90% -->
231
+ <move_factor>0.2</move_factor>
222
232
</default>
223
233
<s3_metrics>
234
+ <!-- items with equal priorities are ordered by their position in config -->
224
235
<volumes>
225
- <volume_s3_metrics>
236
+ <hot>
237
+ <disk>default</disk>
238
+ </hot>
239
+ <cold>
226
240
<disk>s3_metrics</disk>
227
- </volume_s3_metrics>
241
+ <prefer_not_to_merge>true</prefer_not_to_merge>
242
+ <perform_ttl_move_on_insert>0</perform_ttl_move_on_insert>
243
+ </cold>
228
244
</volumes>
245
+ <!-- move data to s3 when disk usage will be more than 90% -->
246
+ <move_factor>0.2</move_factor>
229
247
</s3_metrics>
230
248
<s3_spans>
231
- <volumes>
232
- <volume_s3_spans>
233
- <disk>s3_spans</disk>
234
- </volume_s3_spans>
235
- </volumes>
236
- </s3_spans>
237
- <duo>
238
249
<!-- items with equal priorities are ordered by their position in config -->
239
250
<volumes>
240
251
<hot>
241
252
<disk>default</disk>
242
253
</hot>
243
254
<cold>
244
- <disk>s3_default </disk>
255
+ <disk>s3_spans </disk>
245
256
<prefer_not_to_merge>true</prefer_not_to_merge>
257
+ <perform_ttl_move_on_insert>0</perform_ttl_move_on_insert>
246
258
</cold>
247
259
</volumes>
248
260
<!-- move data to s3 when disk usage will be more than 90% -->
249
- <move_factor>0.1 </move_factor>
250
- </duo >
261
+ <move_factor>0.2 </move_factor>
262
+ </s3_spans >
251
263
</policies>
252
264
</storage_configuration>
253
265
</clickhouse>
@@ -284,14 +296,14 @@ locals {
284
296
logLinePrefix: ""
285
297
logTimezone: ""
286
298
postgresqlDataDir: /bitnami/postgresql/data
287
- persistence:
288
- enabled: true
289
- mountPath: /bitnami/postgresql
290
- size: 1Gi
291
299
readReplicas:
292
300
replicaCount: 0
293
301
primary:
294
302
resourcesPreset: "none"
303
+ persistence:
304
+ enabled: true
305
+ mountPath: /bitnami/postgresql
306
+ size: 512Mi
295
307
EOT
296
308
]
297
309
}
0 commit comments