Fix low resources settings for Clickhouse

This commit is contained in:
Artur Pata
2026-01-02 11:39:11 +02:00
parent 0bafa03fef
commit f602706e0f
4 changed files with 28 additions and 22 deletions

1
.gitignore vendored
View File

@@ -3,6 +3,7 @@
!clickhouse/logs.xml !clickhouse/logs.xml
!clickhouse/ipv4-only.xml !clickhouse/ipv4-only.xml
!clickhouse/low-resources.xml !clickhouse/low-resources.xml
!clickhouse/default-profile-low-resources-overrides.xml
!README.md !README.md
!LICENSE !LICENSE
!.gitignore !.gitignore

View File

@@ -0,0 +1,19 @@
<!-- https://clickhouse.com/docs/en/operations/tips#using-less-than-16gb-of-ram -->
<clickhouse>
<profiles>
<default>
<!-- https://clickhouse.com/docs/en/operations/settings/settings#max_threads -->
<max_threads>1</max_threads>
<!-- https://clickhouse.com/docs/en/operations/settings/settings#max_block_size -->
<max_block_size>8192</max_block_size>
<!-- https://clickhouse.com/docs/en/operations/settings/settings#max_download_threads -->
<max_download_threads>1</max_download_threads>
<!--
https://clickhouse.com/docs/en/operations/settings/settings#input_format_parallel_parsing -->
<input_format_parallel_parsing>0</input_format_parallel_parsing>
<!--
https://clickhouse.com/docs/en/operations/settings/settings#output_format_parallel_formatting -->
<output_format_parallel_formatting>0</output_format_parallel_formatting>
</default>
</profiles>
</clickhouse>

View File

@@ -1,23 +1,4 @@
<!-- https://clickhouse.com/docs/en/operations/tips#using-less-than-16gb-of-ram -->
<clickhouse> <clickhouse>
<!-- <!-- https://clickhouse.com/docs/en/operations/server-configuration-parameters/settings#mark_cache_size -->
https://clickhouse.com/docs/en/operations/server-configuration-parameters/settings#mark_cache_size -->
<mark_cache_size>524288000</mark_cache_size> <mark_cache_size>524288000</mark_cache_size>
<profile>
<default>
<!-- https://clickhouse.com/docs/en/operations/settings/settings#max_threads -->
<max_threads>1</max_threads>
<!-- https://clickhouse.com/docs/en/operations/settings/settings#max_block_size -->
<max_block_size>8192</max_block_size>
<!-- https://clickhouse.com/docs/en/operations/settings/settings#max_download_threads -->
<max_download_threads>1</max_download_threads>
<!--
https://clickhouse.com/docs/en/operations/settings/settings#input_format_parallel_parsing -->
<input_format_parallel_parsing>0</input_format_parallel_parsing>
<!--
https://clickhouse.com/docs/en/operations/settings/settings#output_format_parallel_formatting -->
<output_format_parallel_formatting>0</output_format_parallel_formatting>
</default>
</profile>
</clickhouse> </clickhouse>

View File

@@ -20,9 +20,10 @@ services:
# This makes ClickHouse bind to IPv4 only, since Docker doesn't enable IPv6 in bridge networks by default. # This makes ClickHouse bind to IPv4 only, since Docker doesn't enable IPv6 in bridge networks by default.
# Fixes "Listen [::]:9000 failed: Address family for hostname not supported" warnings. # Fixes "Listen [::]:9000 failed: Address family for hostname not supported" warnings.
- ./clickhouse/ipv4-only.xml:/etc/clickhouse-server/config.d/ipv4-only.xml:ro - ./clickhouse/ipv4-only.xml:/etc/clickhouse-server/config.d/ipv4-only.xml:ro
# This makes ClickHouse consume less resources, which is useful for small setups. # The following configuration files make ClickHouse consume less resources, which is useful for small setups.
# https://clickhouse.com/docs/en/operations/tips#using-less-than-16gb-of-ram # https://clickhouse.com/docs/en/operations/tips#using-less-than-16gb-of-ram
- ./clickhouse/low-resources.xml:/etc/clickhouse-server/config.d/low-resources.xml:ro - ./clickhouse/low-resources.xml:/etc/clickhouse-server/config.d/low-resources.xml:ro
- ./clickhouse/default-profile-low-resources-overrides.xml:/etc/clickhouse-server/users.d/default-profile-low-resources-overrides.xml:ro
ulimits: ulimits:
nofile: nofile:
soft: 262144 soft: 262144
@@ -30,7 +31,11 @@ services:
environment: environment:
- CLICKHOUSE_SKIP_USER_SETUP=1 - CLICKHOUSE_SKIP_USER_SETUP=1
healthcheck: healthcheck:
test: ["CMD-SHELL", "wget --no-verbose --tries=1 -O - http://127.0.0.1:8123/ping || exit 1"] test:
[
"CMD-SHELL",
"wget --no-verbose --tries=1 -O - http://127.0.0.1:8123/ping || exit 1",
]
start_period: 1m start_period: 1m
plausible: plausible: