Skip to content

Commit

Permalink
add low_memory.xml for less clickhouse memory usage
Browse files Browse the repository at this point in the history
  • Loading branch information
Slach committed Nov 18, 2024
1 parent 5eb0d0f commit b5b74b8
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
1 change: 1 addition & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ services:
volumes:
- /var/log/clickhouse-server
- ./docker/clickhouse/init_schema.sql:/docker-entrypoint-initdb.d/init_schema.sql
- ./docker/clickhouse/low_memory.xml:/etc/clickhouse-server/low_memory.xml
- ./docker/clickhouse/postgres_dictionary.xml:/etc/clickhouse-server/postgres_dictionary.xml
- ./docker/clickhouse/listen_ports.xml:/etc/clickhouse-server/config.d/listen_ports.xml
- ./docker/clickhouse/ca-key.pem:/etc/clickhouse-server/ca-key.pem
Expand Down
34 changes: 34 additions & 0 deletions docker/clickhouse/low_memory.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<clickhouse>
<max_thread_pool_size>2000</max_thread_pool_size>
<merge_tree>
<merge_max_block_size>1024</merge_max_block_size>
<max_bytes_to_merge_at_max_space_in_pool>1073741824</max_bytes_to_merge_at_max_space_in_pool>
<number_of_free_entries_in_pool_to_lower_max_size_of_merge>0</number_of_free_entries_in_pool_to_lower_max_size_of_merge>
<number_of_free_entries_in_pool_to_execute_mutation>1</number_of_free_entries_in_pool_to_execute_mutation>
<number_of_free_entries_in_pool_to_execute_optimize_entire_partition>1</number_of_free_entries_in_pool_to_execute_optimize_entire_partition>
</merge_tree>

<mark_cache_size>268435456</mark_cache_size>
<index_mark_cache_size>67108864</index_mark_cache_size>
<uncompressed_cache_size>16777216</uncompressed_cache_size>
<mlock_executable>false</mlock_executable>

<max_connections>64</max_connections>
<max_concurrent_queries>8</max_concurrent_queries>
<max_server_memory_usage_to_ram_ratio>0.75</max_server_memory_usage_to_ram_ratio>

<background_buffer_flush_schedule_pool_size>1</background_buffer_flush_schedule_pool_size>
<background_pool_size>2</background_pool_size>
<background_merges_mutations_concurrency_ratio>2</background_merges_mutations_concurrency_ratio>
<background_merges_mutations_scheduling_policy>round_robin</background_merges_mutations_scheduling_policy>
<background_move_pool_size>1</background_move_pool_size>
<background_fetches_pool_size>1</background_fetches_pool_size>
<background_common_pool_size>2</background_common_pool_size>
<background_schedule_pool_size>8</background_schedule_pool_size>
<background_message_broker_schedule_pool_size>1</background_message_broker_schedule_pool_size>
<background_distributed_schedule_pool_size>1</background_distributed_schedule_pool_size>
<tables_loader_foreground_pool_size>0</tables_loader_foreground_pool_size>
<tables_loader_background_pool_size>0</tables_loader_background_pool_size>
<query_thread_log remove="1" />
<processors_profile_log remove="1" />
</clickhouse>

0 comments on commit b5b74b8

Please sign in to comment.