mirror of
https://github.com/plausible/hosting.git
synced 2024-12-22 03:53:18 -06:00
Disable resource-hungry clickhouse logging & metrics
Also includes a bunch of smaller optimizations
This commit is contained in:
parent
a7683ced44
commit
5d21be20d5
3
.gitignore
vendored
3
.gitignore
vendored
@ -1,6 +1,7 @@
|
|||||||
*
|
*
|
||||||
!compose.yml
|
!compose.yml
|
||||||
!clickhouse/logs.xml
|
!clickhouse/clickhouse-config.xml
|
||||||
|
!clickhouse/clickhouse-user-config.xml
|
||||||
!clickhouse/ipv4-only.xml
|
!clickhouse/ipv4-only.xml
|
||||||
!README.md
|
!README.md
|
||||||
!LICENSE
|
!LICENSE
|
||||||
|
17
clickhouse/clickhouse-config.xml
Normal file
17
clickhouse/clickhouse-config.xml
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
<clickhouse>
|
||||||
|
<logger>
|
||||||
|
<level>warning</level>
|
||||||
|
<console>true</console>
|
||||||
|
</logger>
|
||||||
|
|
||||||
|
<!-- Stop all the unnecessary logging -->
|
||||||
|
<query_thread_log remove="remove"/>
|
||||||
|
<query_metric_log remove="remove"/>
|
||||||
|
<query_log remove="remove"/>
|
||||||
|
<text_log remove="remove"/>
|
||||||
|
<trace_log remove="remove"/>
|
||||||
|
<metric_log remove="remove"/>
|
||||||
|
<asynchronous_metric_log remove="remove"/>
|
||||||
|
<session_log remove="remove"/>
|
||||||
|
<part_log remove="remove"/>
|
||||||
|
</clickhouse>
|
17
clickhouse/clickhouse-user-config.xml
Normal file
17
clickhouse/clickhouse-user-config.xml
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
<clickhouse>
|
||||||
|
<profiles>
|
||||||
|
<default>
|
||||||
|
<log_queries>0</log_queries>
|
||||||
|
<log_query_threads>0</log_query_threads>
|
||||||
|
<max_block_size>1024</max_block_size>
|
||||||
|
<max_download_threads>1</max_download_threads>
|
||||||
|
<input_format_parallel_parsing>0</input_format_parallel_parsing>
|
||||||
|
<output_format_parallel_formatting>0</output_format_parallel_formatting>
|
||||||
|
</default>
|
||||||
|
</profiles>
|
||||||
|
|
||||||
|
<asynchronous_metrics_update_period_s>60</asynchronous_metrics_update_period_s>
|
||||||
|
<dns_cache_update_period>90</dns_cache_update_period>
|
||||||
|
<mark_cache_size>524288000</mark_cache_size>
|
||||||
|
|
||||||
|
</clickhouse>
|
@ -1,36 +0,0 @@
|
|||||||
<clickhouse>
|
|
||||||
<logger>
|
|
||||||
<level>warning</level>
|
|
||||||
<console>true</console>
|
|
||||||
</logger>
|
|
||||||
|
|
||||||
<query_log replace="1">
|
|
||||||
<database>system</database>
|
|
||||||
<table>query_log</table>
|
|
||||||
<flush_interval_milliseconds>7500</flush_interval_milliseconds>
|
|
||||||
<engine>
|
|
||||||
ENGINE = MergeTree
|
|
||||||
PARTITION BY event_date
|
|
||||||
ORDER BY (event_time)
|
|
||||||
TTL event_date + interval 30 day
|
|
||||||
SETTINGS ttl_only_drop_parts=1
|
|
||||||
</engine>
|
|
||||||
</query_log>
|
|
||||||
|
|
||||||
<metric_log>
|
|
||||||
<partition_by>event_date</partition_by>
|
|
||||||
<ttl>event_date + INTERVAL 30 DAY DELETE</ttl>
|
|
||||||
</metric_log>
|
|
||||||
|
|
||||||
<asynchronous_metric_log>
|
|
||||||
<partition_by>event_date</partition_by>
|
|
||||||
<ttl>event_date + INTERVAL 30 DAY DELETE</ttl>
|
|
||||||
</asynchronous_metric_log>
|
|
||||||
|
|
||||||
<!-- Stops unnecessary logging -->
|
|
||||||
<query_thread_log remove="remove" />
|
|
||||||
<text_log remove="remove" />
|
|
||||||
<trace_log remove="remove" />
|
|
||||||
<session_log remove="remove" />
|
|
||||||
<part_log remove="remove" />
|
|
||||||
</clickhouse>
|
|
@ -14,9 +14,8 @@ services:
|
|||||||
image: clickhouse/clickhouse-server:24.11.1.2557-alpine
|
image: clickhouse/clickhouse-server:24.11.1.2557-alpine
|
||||||
restart: always
|
restart: always
|
||||||
volumes:
|
volumes:
|
||||||
- event-data:/var/lib/clickhouse
|
- ./clickhouse/clickhouse-config.xml:/etc/clickhouse-server/config.d/logging.xml:ro
|
||||||
- event-logs:/var/log/clickhouse-server
|
- ./clickhouse/clickhouse-user-config.xml:/etc/clickhouse-server/config.d/user.xml:ro
|
||||||
- ./clickhouse/logs.xml:/etc/clickhouse-server/config.d/logs.xml:ro
|
|
||||||
# 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
|
||||||
|
Loading…
Reference in New Issue
Block a user