Skip to main content
These settings configure the ClickHouse server and are autogenerated from ClickHouse source.

abort_on_logical_error

Crash the server on LOGICAL_ERROR exceptions. Only for experts.

ai_function_allow_sql_named_collections

Allows AI functions (such as aiGenerate, aiEmbed, aiSimilarity) to use named collections created with CREATE NAMED COLLECTION. When disabled, AI functions accept only named collections defined in the server configuration file, and using any other collection throws an exception. This applies both to the credentials parameter and to the ai_function_text_default_credentials and ai_function_embedding_default_credentials settings.

allowed_disks_for_table_engines

List of disks allowed for use with Iceberg

auth_use_forwarded_address

Use originating address for authentication for clients connected through proxy.
  • Default: false
This setting should be used with extra caution since forwarded addresses can be easily spoofed - servers accepting such authentication should not be accessed directly but rather exclusively through a trusted proxy.

bcrypt_workfactor

Work factor for the bcrypt_password authentication type which uses the Bcrypt algorithm. The work factor defines the amount of computations and time needed to compute the hash and verify the password.
  • Default: 12
For applications with high-frequency authentication, consider alternative authentication methods due to bcrypt’s computational overhead at higher work factors.

blob_storage_log

Settings for the blob_storage_log system table. The following settings can be configured by sub-tags: All settings except database, table and engine can also be set once for all system log tables in the system_tables section. A setting inside a particular table’s section takes precedence, and a per-table engine replaces the whole engine definition, including the global partition_by, ttl, order_by, storage_policy and settings:
The system_tables section additionally accepts the following setting, which applies to all system log tables and cannot be set per table: The previous location of this setting, default_system_log_flush_policy.skip_alias_columns, is deprecated and is used only if system_tables.skip_alias_columns is not set. Example:

builtin_dictionaries_reload_interval

The interval in seconds before reloading built-in dictionaries. ClickHouse reloads built-in dictionaries every x seconds. This makes it possible to edit dictionaries “on the fly” without restarting the server. Example

cache_size_to_ram_max_ratio

Set cache size to RAM max ratio. Allows lowering the cache size on low-memory systems.

cannot_allocate_thread_fault_injection_probability

For testing purposes.

cgroups_memory_usage_observer_wait_time

Interval in seconds during which the server’s maximum allowed memory consumption is adjusted by the corresponding threshold in cgroups. To disable the cgroup observer, set this value to 0.

collect_connection_metrics

Enables the collection of connections for the system.connections table. This table shows the connections of the native TCP and HTTP query interfaces. It does not show connections of MySQL, PostgreSQL, gRPC, or other protocols. When you set this setting to true, the server keeps a list of connections in memory:
  • The server adds a native TCP connection to the list after authentication.
  • The server adds an HTTP connection to the list when the connection gets its first query.
  • The server removes a connection from the list when the connection closes. Between the requests, an HTTP keep-alive connection has the status idle.
Each connection and each query has a small synchronization cost. Thus, the default value is false. A user without the SHOW CONNECTIONS privilege sees only the connections of this user. You can change this setting without a restart. When you change it to false, system.connections becomes empty and the server stops the registration of new connections. When you change it to true, an open connection shows in system.connections on its next query. Example configuration:
See also: system.connections, system.processes.

compression

Data compression settings for MergeTree-engine tables.
We recommend not changing this if you have just started using ClickHouse.
Configuration template:
<case> fields:
  • min_part_size – The minimum size of a data part.
  • min_part_size_ratio – The ratio of the data part size to the table size.
  • method – Compression method. Acceptable values: lz4, lz4hc, zstd,deflate_qpl.
  • level – Compression level. See Codecs.
You can configure multiple <case> sections.
Actions when conditions are met:
  • If a data part matches a condition set, ClickHouse uses the specified compression method.
  • If a data part matches multiple condition sets, ClickHouse uses the last matched condition set (the <case> sections are checked in order, and each matching one overrides the previous choice).
If no conditions are met for a data part, ClickHouse uses the size-aware built-in default: LZ4 below 100 MB and ZSTD(3) at or above it. As for the min_part_size conditions above, the size is the one known when the codec has to be chosen, before the data is written: the uncompressed size of the inserted block for a freshly inserted part, and the size of the source parts for a merge or a mutation. So small inserts are written with LZ4, and large inserts are written with ZSTD(3) right away. A rewrite that shrinks its input, such as a TTL DELETE or a collapsing merge, is therefore classified by the input size and can produce a part below the threshold that is still ZSTD(3).
Example

config-file

Points to the server config file.

config_reload_interval_ms

How often clickhouse will reload config and check for new changes

core_dump

Configures soft limit for core dump file size.
Hard limit is configured via system tools
Example

crash_log

Settings for the crash_log system table operation. The following settings can be configured by sub-tags: The default server configuration file config.xml contains the following settings section:

create_union_system_log_tables

Requests the creation of all_... tables next to the system log tables (system.all_query_log for system.query_log, system.all_text_log for system.text_log, and so on). Such a table is a union of the corresponding log table, its rotated versions (query_log_0, query_log_1, …) and/or the same tables across all replicas of a cluster, and allows querying them all at once without remembering constructs like clusterAllReplicas(default, merge(system, '^query_log')). The section is optional. The default server configuration file config.xml contains this section with merge_rotated_tables enabled, so the all_... tables are created automatically on a default server: at the first flush of each log, or on startup if prepare_system_log_tables_on_startup is enabled; the cluster setting has to be configured explicitly. A table that already exists under one of the all_... names and was not created by this feature (for example, a hand-made table with data) is never replaced: it is left intact and a warning is written to the server log, and the union table is created at the next flush of the log once that table is dropped or renamed. The tables created by this feature are recognized by the marker sentence at the end of their comment: It is safe to drop this table at any time: it will be recreated automatically. If the section is present, at least one of the following settings has to be specified: If both settings are specified, the table is a union of the rotated tables across all replicas of the cluster. The option applies to all system log tables; it does not allow for a different configuration for different system logs. The tables are created in the same database as the system log tables at the first flush of each log and are automatically recreated when the structure of the log table changes (on rotation). They have no state, so it is safe to drop them at any time. The creation is supported only for the Atomic, Replicated and Shared database engines.
When the cluster setting is used, the table definition references the cluster, and the cluster has to exist for the table to be loaded. If you remove the cluster from the configuration, also drop the all_... tables (they will be recreated according to the new configuration at the next flush).
A table under one of the all_... names is considered to be created by this feature, and may be replaced when its definition differs from the expected one, only if it selects from the merge or clusterAllReplicas table function and its comment contains the marker sentence above. Do not copy this sentence into the comments of your own tables.
Example

database_atomic_delay_before_drop_table_sec

The delay during which a dropped table can be restored using the UNDROP statement. If DROP TABLE ran with a SYNC modifier, the setting is ignored. The default for this setting is 480 (8 minutes).

dead_letter_queue

Setting for the ‘dead_letter_queue’ system table. The following settings can be configured by sub-tags: All settings except database, table and engine can also be set once for all system log tables in the system_tables section. A setting inside a particular table’s section takes precedence, and a per-table engine replaces the whole engine definition, including the global partition_by, ttl, order_by, storage_policy and settings:
The system_tables section additionally accepts the following setting, which applies to all system log tables and cannot be set per table: The previous location of this setting, default_system_log_flush_policy.skip_alias_columns, is deprecated and is used only if system_tables.skip_alias_columns is not set. The default settings are:

dictionary_background_reconnect_interval

Interval in milliseconds for reconnection attempts of failed MySQL and Postgres dictionaries having background_reconnect enabled.

disk_transaction_wait_for_blob_removal

Default value for the per-disk wait_for_blob_removal setting. When enabled, the server waits for background blob removal to complete before acknowledging the operation.

display_secrets_in_show_and_select

Enables or disables showing secrets in SHOW and SELECT queries for tables, databases, table functions, and dictionaries. User wishing to see secrets must also have format_display_secrets_in_show_and_select format setting turned on and a displaySecretsInShowAndSelect privilege. Possible values:
  • 0 — Disabled.
  • 1 — Enabled.

dns_max_consecutive_failures

Stop further attempts to update a hostname’s DNS cache after this number of consecutive failures. The information still remains in the DNS cache. Zero means unlimited. See also

dynamic_user_defined_executable_functions_path

The directory used to keep configuration files of executable UDFs created dynamically by drivers (see CREATE FUNCTION ... ENGINE = DriverName(...)). On server restart, the directory is scanned for configuration files and the corresponding UDFs are loaded without invoking the driver again. Example

encryption

Configures a command to obtain a key to be used by encryption codecs. Key (or keys) should be written in environment variables or set in the configuration file. Keys can be hex or string with a length equal to 16 bytes. Example Loading from config:
Storing keys in the configuration file is not recommended. It isn’t secure. You can move the keys into a separate config file on a secure disk and put a symlink to that config file to config.d/ folder.
Loading from config, when the key is in hex:
Loading key from the environment variable:
Here current_key_id sets the current key for encryption, and all specified keys can be used for decryption. Each of these methods can be applied for multiple keys:
Here current_key_id shows current key for encryption. Also, users can add nonce that must be 12 bytes long (by default encryption and decryption processes use nonce that consists of zero bytes):
Or it can be set in hex:
Everything mentioned above can be applied for aes_256_gcm_siv (but the key must be 32 bytes long).

enforce_keeper_component_tracking

If enabled, every ZooKeeper request must have a component name set via Coordination::setCurrentComponent. Throws a LOGICAL_ERROR exception if the component is missing.

error_log

It is disabled by default. Enabling To manually turn on error history collection system.error_log, create /etc/clickhouse-server/config.d/error_log.xml with the following content:
Disabling To disable error_log setting, you should create the following file /etc/clickhouse-server/config.d/disable_error_log.xml with the following content:
The following settings can be configured by sub-tags: All settings except database, table and engine can also be set once for all system log tables in the system_tables section. A setting inside a particular table’s section takes precedence, and a per-table engine replaces the whole engine definition, including the global partition_by, ttl, order_by, storage_policy and settings:
The system_tables section additionally accepts the following setting, which applies to all system log tables and cannot be set per table: The previous location of this setting, default_system_log_flush_policy.skip_alias_columns, is deprecated and is used only if system_tables.skip_alias_columns is not set.

filesystem_caches_path

This setting specifies the cache path. Example

google_protos_path

Defines a directory containing proto files for Protobuf types. Example

handshake_timeout_milliseconds

Wall-clock timeout in milliseconds for the entire handshake phase of a native protocol (Hello and Addendum), MySQL or PostgreSQL connection, including the TLS negotiation. Limits how long an unauthenticated connection can hold a thread: the deadline is checked on every read, and the socket receive timeout is clamped to it, so a client that sends nothing cannot outlast the budget either. That clamp keeps a floor of 100 milliseconds, so a small value overdraws the budget slightly rather than cutting reads too short. Set to 0 to disable.

hdfs.libhdfs3_conf

Points libhdfs3 to the right location for its config.

hsts_max_age

Expired time for HSTS in seconds.
A value of 0 means ClickHouse disables HSTS. If you set a positive number, the HSTS will be enabled and the max-age is the number you set.
Example

iceberg_background_schedule_pool_size

Size of thread pool to asynchronously fetch the latest metadata from a remote iceberg catalog; the pool is shared by all the active tables.

iceberg_manifest_decode_thread_pool_queue_size

The maximum number of jobs that can be scheduled on the thread pool for decoding Iceberg data manifest files. The setting is deprecated and has no effect: Iceberg manifest files are read on the IO thread pool.

ignore_empty_sql_security_in_create_view_query

If true, a CREATE VIEW or CREATE MATERIALIZED VIEW query that specifies neither DEFINER nor SQL SECURITY is stored as written, and the view gets an empty SQL security type. Specifying DEFINER alone counts as SQL SECURITY DEFINER, so such a query is unaffected by this setting. A normal view with an empty SQL security type runs with the permissions of the invoker. For a materialized view with an explicitly specified target table, the access checks on the target table are skipped: inserting into the source table does not require the INSERT privilege on the target table, and reading from the view does not require the SELECT privilege on it. If false, the defaults from the default_normal_view_sql_security, default_materialized_view_sql_security, and default_view_definer settings are written into the view definition at creation time. With the default values of those settings, a materialized view created with neither clause records the creating user as its definer and runs with that user’s permissions. Refreshable materialized views always receive the defaults, regardless of this setting.
Changing this setting affects only views created afterwards; the stored definitions of existing views stay unchanged.

include_from

The path to the file with substitutions. Both XML and YAML formats are supported. For more information, see the section Configuration files. Empty by default, which means that no substitutions file is used. Before version 26.8 the file /etc/metrika.xml was used implicitly whenever it existed; if you rely on it, specify the path explicitly. Note that configuration files that are loaded separately from the main server configuration — the users’ configuration (e.g. users.xml when it is not included in the main file) and XML dictionary configurations — read the include_from element from their own contents, not from the server configuration. Each such file that relies on substitutions needs its own include_from element. Example

insert_deduplication_version

Deprecated migration guard. ClickHouse versions 26.7 and later support only the unified insert deduplication hash (new_unified_hash); the server refuses to start if this setting is present with any other value (such as old_separate_hashes or compatible_double_hashes). Complete the deduplication migration on the previous version before upgrading by running compatible_double_hashes (which writes both the legacy and unified hashes). For replicated tables run it for at least replicated_deduplication_window_seconds (one hour by default); the default windows retain the unified hashes of all inserts for that window, which is considered enough to cover an insert retry loop. For non-replicated tables with non_replicated_deduplication_window > 0 the window is count-based rather than time-based, so run compatible_double_hashes for at least that many inserts before upgrading.

io_thread_pool_queue_size

The maximum number of jobs that can be scheduled on the IO Thread pool.
A value of 0 means unlimited.

keep_alive_timeout

The number of seconds that ClickHouse waits for incoming requests for HTTP protocol before closing the connection. Example

ldap_servers

List LDAP servers with their connection parameters here to:
  • use them as authenticators for dedicated local users, who have an ‘ldap’ authentication mechanism specified instead of ‘password’
  • use them as remote user directories.
The following settings can be configured by sub-tags: Setting user_dn_detection can be configured with sub-tags: Example:
Example (typical Active Directory with configured user DN detection for further role mapping):

logger

The location and format of log messages. Keys: Log format specifiers File names in log and errorLog paths support below format specifiers for the resulting file name (the directory part does not support them). Column “Example” shows the output at 2023-07-06 18:32:07. Example
To print log messages only in the console:
Per-level Overrides The log level of individual log names can be overridden. For example, to mute all messages of loggers “Backup” and “RBAC”.
syslog To write log messages additionally to syslog:
Keys for <syslog>: Log formats You can specify the log format that will be outputted in the console log. Currently, only JSON is supported. Example Here is an example of an output JSON log:
To enable JSON logging support, use the following snippet:
Renaming keys for JSON logs Key names can be modified by changing tag values inside the <names> tag. For example, to change DATE_TIME to MY_DATE_TIME, you can use <date_time>MY_DATE_TIME</date_time>. Omitting keys for JSON logs Log properties can be omitted by commenting out the property. For example, if you do not want your log to print query_id, you can comment out the <query_id> tag.

logger.count

Rotation policy: How many historical log files ClickHouse are kept at most.

logger.errorlog

The path to the error log file.

logger.formatting.type

Log format for console output. Currently, only <json> is supported.

logger.level

Log level. Acceptable values: <none> (turn logging off), <fatal>, <critical>, <error>, <warning>, <notice>, <information>, <debug>, <trace>, <test>.

logger.log

The path to the log file.

logger.rotation

Rotation policy: Controls when log files are rotated. Rotation can be based on size, time, or a combination of both. Examples: 100M, daily, 100M,daily. Once the log file exceeds the specified size or when the specified time interval is reached, it is renamed and archived, and a new log file is created.

logger.shutdown_level

Shutdown level is used to set the root logger level at server Shutdown.

logger.size

Rotation policy: Maximum size of the log files in bytes. Once the log file size exceeds this threshold, it is renamed and archived, and a new log file is created.

logger.startup_level

Startup level is used to set the root logger level at server startup. After startup log level is reverted to the <level> setting.

logger.stream_compress

Compress log messages using LZ4. Set to <1> or <true> to enable.

logger.syslog_level

Log level for logging to syslog.

logger.use_syslog

Also forward log output to syslog.

macros

Parameter substitutions for replicated tables. Can be omitted if replicated tables are not used. For more information, see the section Creating replicated tables. Example

message_queue_disable_insertion

Disable insertion from message queue engines (Kafka, RabbitMQ, NATS) into attached materialized views

metric_log

It is disabled by default. Enabling To manually turn on metrics history collection system.metric_log, create /etc/clickhouse-server/config.d/metric_log.xml with the following content:
Disabling To disable metric_log setting, you should create the following file /etc/clickhouse-server/config.d/disable_metric_log.xml with the following content:
The following settings can be configured by sub-tags: All settings except database, table and engine can also be set once for all system log tables in the system_tables section. A setting inside a particular table’s section takes precedence, and a per-table engine replaces the whole engine definition, including the global partition_by, ttl, order_by, storage_policy and settings:
The system_tables section additionally accepts the following setting, which applies to all system log tables and cannot be set per table: The previous location of this setting, default_system_log_flush_policy.skip_alias_columns, is deprecated and is used only if system_tables.skip_alias_columns is not set.

mmap_cache_size

This setting allows avoiding frequent open/close calls (which are very expensive due to consequent page faults), and to reuse mappings from several threads and queries. The setting value is the number of mapped regions (usually equal to the number of mapped files). The amount of data in mapped files can be monitored in the following system tables with the following metrics:
The amount of data in mapped files does not consume memory directly and is not accounted for in query or server memory usage — because this memory can be discarded similar to the OS page cache. The cache is dropped (the files are closed) automatically on the removal of old parts in tables of the MergeTree family, also it can be dropped manually by the SYSTEM DROP MMAP CACHE query.This setting can be modified at runtime and will take effect immediately.

mutation_workload

Used to regulate how resources are utilized and shared between mutations and other workloads. Specified value is used as workload setting value for all background mutations. Can be overridden by a merge tree setting. See Also

named_collections_storage.type

The storage type for named collections. Possible values are local, local_encrypted, keeper, keeper_encrypted, zookeeper, and zookeeper_encrypted. Configured as named_collections_storage.type (<named_collections_storage><type> in XML).

oom_score

On Linux systems this can control the behavior of OOM killer.

openSSL

SSL client/server configuration. Support for SSL is provided by the libpoco library. The available configuration options are explained in SSLManager.h. Default values can be found in SSLManager.cpp. The files referenced by certificateFile, privateKeyFile and caConfig are reloaded without a restart when they change or on SYSTEM RELOAD CONFIG. New connections use the reloaded certificates, established connections are not affected. Keys for server/client settings: Example of settings:

openSSL.client.caConfig

Path to the file or directory that contains trusted CA certificates. If this points to a file, it must be in PEM format and can contain several CA certificates. If this points to a directory, it must contain one .pem file per CA certificate. The filenames are looked up by the CA subject name hash value. Details can be found in the man page of SSL_CTX_load_verify_locations. The CA certificates are reloaded without a restart when the file changes or on SYSTEM RELOAD CONFIG; new connections are verified against the reloaded certificates.

openSSL.client.cacheSessions

Enables or disables caching sessions. Must be used in combination with <sessionIdContext>. Acceptable values: <true>, <false>.

openSSL.client.certificateFile

Path to the client/server certificate file in PEM format. You can omit it if <privateKeyFile> contains the certificate.

openSSL.client.cipherList

Supported OpenSSL encryptions.

openSSL.client.cipherSuites

Supported TLS 1.3 cipher suites in OpenSSL notation. An empty value leaves the OpenSSL default suites in place. <cipherList> only applies to TLS 1.2 and below. Suite names OpenSSL does not recognize are ignored; a value that leaves no recognized suite is an error and the TLS context fails to initialize.

openSSL.client.disableProtocols

Protocols that are not allowed to be used.

openSSL.client.extendedVerification

If enabled, verify that the certificate CN or SAN matches the peer hostname.

openSSL.client.fips

Activates OpenSSL FIPS mode. Supported if the library’s OpenSSL version supports FIPS.

openSSL.client.invalidCertificateHandler.name

Class (a subclass of CertificateHandler) for verifying invalid certificates. For example: <<invalidCertificateHandler> <name>RejectCertificateHandler</name> </invalidCertificateHandler>>.

openSSL.client.loadDefaultCAFile

Determines whether the default CA certificates will be used. ClickHouse looks for them in the file </etc/ssl/cert.pem> (resp. the directory </etc/ssl/certs>), in the file (resp. directory) specified by the environment variable <SSL_CERT_FILE> (resp. <SSL_CERT_DIR>), and in other well-known locations of various distributions. If no CA certificates are found on the filesystem, no explicit caConfig is configured, and the binary was built with embedded CA certificates (the default, controlled by the ENABLE_EMBEDDED_CA_CERTIFICATES build option), the embedded certificates are used instead, so TLS works even in a minimal environment without any files, e.g. in a container built “from scratch”. In builds without embedded CA certificates, an error is thrown in this case.

openSSL.client.preferServerCiphers

Client-preferred server ciphers.

openSSL.client.privateKeyFile

Path to the file with the secret key of the PEM certificate. The file may contain a key and certificate at the same time.

openSSL.client.privateKeyPassphraseHandler.name

Class (PrivateKeyPassphraseHandler subclass) that requests the passphrase for accessing the private key. For example: <<privateKeyPassphraseHandler>>, <<name>KeyFileHandler</name>>, <<options><password>test</password></options>>, <</privateKeyPassphraseHandler>>

openSSL.client.verificationDepth

The maximum length of the verification chain. Verification will fail if the certificate chain length exceeds the set value.

openSSL.client.verificationMode

The method for checking the node’s certificates. Details are in the description of the Context class. Possible values: <none>, <relaxed>, <strict>, <once>.

openSSL.server.caConfig

Path to the file or directory that contains trusted CA certificates. If this points to a file, it must be in PEM format and can contain several CA certificates. If this points to a directory, it must contain one .pem file per CA certificate. The filenames are looked up by the CA subject name hash value. Details can be found in the man page of SSL_CTX_load_verify_locations. The CA certificates are reloaded without a restart when the file changes or on SYSTEM RELOAD CONFIG; new connections are verified against the reloaded certificates.

openSSL.server.cacheSessions

Enables or disables caching sessions. Must be used in combination with <sessionIdContext>. Acceptable values: <true>, <false>.

openSSL.server.certificateFile

Path to the client/server certificate file in PEM format. You can omit it if <privateKeyFile> contains the certificate.

openSSL.server.cipherList

Supported OpenSSL encryptions.

openSSL.server.cipherSuites

Supported TLS 1.3 cipher suites in OpenSSL notation. An empty value leaves the OpenSSL default suites in place. <cipherList> only applies to TLS 1.2 and below. Suite names OpenSSL does not recognize are ignored; a value that leaves no recognized suite is an error and the TLS context fails to initialize.

openSSL.server.disableProtocols

Protocols that are not allowed to be used.

openSSL.server.extendedVerification

If enabled, verify that the certificate CN or SAN matches the peer hostname.

openSSL.server.fips

Activates OpenSSL FIPS mode. Supported if the library’s OpenSSL version supports FIPS.

openSSL.server.invalidCertificateHandler.name

Class (a subclass of CertificateHandler) for verifying invalid certificates. For example: <<invalidCertificateHandler> <name>RejectCertificateHandler</name> </invalidCertificateHandler>>.

openSSL.server.loadDefaultCAFile

Determines whether the default CA certificates will be used. ClickHouse looks for them in the file </etc/ssl/cert.pem> (resp. the directory </etc/ssl/certs>), in the file (resp. directory) specified by the environment variable <SSL_CERT_FILE> (resp. <SSL_CERT_DIR>), and in other well-known locations of various distributions. If no CA certificates are found on the filesystem, no explicit caConfig is configured, and the binary was built with embedded CA certificates (the default, controlled by the ENABLE_EMBEDDED_CA_CERTIFICATES build option), the embedded certificates are used instead, so TLS works even in a minimal environment without any files, e.g. in a container built “from scratch”. In builds without embedded CA certificates, an error is thrown in this case.

openSSL.server.preferServerCiphers

Client-preferred server ciphers.

openSSL.server.privateKeyFile

Path to the file with the secret key of the PEM certificate. The file may contain a key and certificate at the same time.

openSSL.server.privateKeyPassphraseHandler.name

Class (PrivateKeyPassphraseHandler subclass) that requests the passphrase for accessing the private key. For example: <<privateKeyPassphraseHandler>>, <<name>KeyFileHandler</name>>, <<options><password>test</password></options>>, <</privateKeyPassphraseHandler>>

openSSL.server.sessionCacheSize

The maximum number of sessions that the server caches. A value of 0 means unlimited sessions.

openSSL.server.sessionIdContext

A unique set of random characters that the server appends to each generated identifier. The length of the string must not exceed <SSL_MAX_SSL_SESSION_ID_LENGTH>. This parameter is always recommended since it helps avoid problems both if the server caches the session and if the client requested caching.

openSSL.server.sessionTimeout

Time for caching the session on the server in hours.

openSSL.server.verificationDepth

The maximum length of the verification chain. Verification will fail if the certificate chain length exceeds the set value.

openSSL.server.verificationMode

The method for checking the node’s certificates. Details are in the description of the Context class. Possible values: <none>, <relaxed>, <strict>, <once>.

opentelemetry_span_log

Settings for the opentelemetry_span_log system table. The following settings can be configured by sub-tags: All settings except database, table and engine can also be set once for all system log tables in the system_tables section. A setting inside a particular table’s section takes precedence, and a per-table engine replaces the whole engine definition, including the global partition_by, ttl, order_by, storage_policy and settings:
The system_tables section additionally accepts the following setting, which applies to all system log tables and cannot be set per table: The previous location of this setting, default_system_log_flush_policy.skip_alias_columns, is deprecated and is used only if system_tables.skip_alias_columns is not set. Example:

part_log

Logging events that are associated with MergeTree. For instance, adding or merging data. You can use the log to simulate merge algorithms and compare their characteristics. You can visualize the merge process. Queries are logged in the system.part_log table, not in a separate file. You can configure the name of this table in the table parameter (see below). The following settings can be configured by sub-tags: All settings except database, table and engine can also be set once for all system log tables in the system_tables section. A setting inside a particular table’s section takes precedence, and a per-table engine replaces the whole engine definition, including the global partition_by, ttl, order_by, storage_policy and settings:
The system_tables section additionally accepts the following setting, which applies to all system log tables and cannot be set per table: The previous location of this setting, default_system_log_flush_policy.skip_alias_columns, is deprecated and is used only if system_tables.skip_alias_columns is not set. Example

path

The path to the directory containing data.
The trailing slash is mandatory.
Example

per_cpu_untracked_memory_thread_buffer

Amount of untracked memory, in bytes, each thread may hold without touching the shared per-CPU budget. It amortizes the cost of the per-CPU bookkeeping for small allocations and is the slack added on top of max_per_cpu_untracked_memory * number_of_cpus in the worst case. A value of 0 removes the slack: every allocation updates the shared per-CPU counter (most precise, but more contention). Linux only.

placement

The cloud availability zone and region the server runs in. The availability zone is used by the ZooKeeper client to prefer hosts in the same zone (prefer_local_availability_zone in the zookeeper section), and by ClickHouse Keeper, which publishes it in the /keeper/availability_zone node. If the placement section is absent, the availability zone and region are empty. The following settings are available: The placement is read once, at server startup. Example

point_in_polygon_cache_size

Maximum size in bytes of the cache of preprocessed polygons used by the function pointInPolygon with a constant polygon argument. Entries above the limit are evicted in least recently used order. Setting it to 0 disables the cache: all cached polygons are evicted, and every subsequent query preprocesses its constant polygon anew. The cache can also be cleared manually, without changing this limit, with the SYSTEM DROP POINT IN POLYGON CACHE query.
This setting can be modified at runtime and will take effect immediately.

prefixes_deserialization_thread_pool_thread_pool_queue_size

The maximum number of jobs that can be scheduled on the prefixes deserialization Thread pool.
A value of 0 means unlimited.

prepare_system_log_tables_on_startup

If true, ClickHouse creates all configured system.*_log tables before the startup. It can be helpful if some startup scripts depend on these tables.

process_query_plan_packet

This setting allows reading QueryPlan packet. This packet is sent for distributed queries when serialize_query_plan is enabled. Disabled by default to avoid possible security issues which can be caused by bugs in query plan binary deserialization. Example

processors_profile_log

Settings for the processors_profile_log system table. The following settings can be configured by sub-tags: All settings except database, table and engine can also be set once for all system log tables in the system_tables section. A setting inside a particular table’s section takes precedence, and a per-table engine replaces the whole engine definition, including the global partition_by, ttl, order_by, storage_policy and settings:
The system_tables section additionally accepts the following setting, which applies to all system log tables and cannot be set per table: The previous location of this setting, default_system_log_flush_policy.skip_alias_columns, is deprecated and is used only if system_tables.skip_alias_columns is not set. The default settings are:

prometheus

Exposing metrics data for scraping from Prometheus. Settings:
  • endpoint – HTTP endpoint for scraping metrics by prometheus server. Start from ’/’.
  • port – Port for endpoint.
  • metrics – Expose metrics from the system.metrics table.
  • events – Expose metrics from the system.events table.
  • asynchronous_metrics – Expose current metrics values from the system.asynchronous_metrics table. Key-value metrics (those broken down per CPU core, block device, network interface, or disk) are exposed as one sample per key, carrying the key as a label: ClickHouseAsyncMetrics_BlockReadBytes{device="sda"}. The asynchronous_metrics_key_values_mode server setting exposes them under their pre-26.8 mangled names instead (ClickHouseAsyncMetrics_BlockReadBytes_sda), or both ways at once.
  • errors - Expose the number of errors by error codes occurred since the last server restart. This information could be obtained from the system.errors as well.
  • labels – Constant labels added to every exposed metric. Each child element defines one label: the element name is the label name (must match [a-zA-Z_][a-zA-Z0-9_]*) and the element value is the label value. Label values support standard config substitutions such as the from_env attribute. A label name is rejected when it starts with __ (reserved by Prometheus), or when it would collide with a label this endpoint already writes for one of its enabled sections — otherwise a sample would carry the same label name twice. The reserved set therefore follows the endpoint’s active export surface: le when histograms is enabled; the ClickHouse_Info labels (name, version, version_describe, version_major, version_minor, version_patch) when info is enabled; the key labels of the key-value asynchronous metrics (channel, cpu, device, disk, interface, mc, sensor) when asynchronous_metrics is enabled and they are published in the key-value form, which the asynchronous_metrics_key_values_mode server setting decides; and any label used by an exposed histogram or dimensional metric family (for example group, direction, or operation_type) when histograms/dimensional_metrics is enabled. Because it depends on what the endpoint actually exposes, a name can be valid on one endpoint but rejected on another — for example a Keeper keeper_metrics_only endpoint exposes only the keeper_* families, so labels used only by server families are accepted there. The constant labels are validated against the same rule when a configuration is loaded, including on SYSTEM RELOAD CONFIG: a reload that would make a constant label collide - by adding such a label, or by changing asynchronous_metrics_key_values_mode so that the key labels start being written - is rejected as a whole before it takes effect, instead of exposing the same label twice. An accepted change of the mode re-creates the endpoints that expose the metrics, so that the new form and the labels of the same configuration are published together.
Example
Check (replace 127.0.0.1 with the IP addr or hostname of your ClickHouse server):

prometheus.keeper_metrics_only

Expose the keeper related metrics

proxy

Define proxy servers for HTTP and HTTPS requests, currently supported by S3 storage, S3 table functions, and URL functions. There are three ways to define proxy servers:
  • environment variables
  • proxy lists
  • remote proxy resolvers.
Bypassing proxy servers for specific hosts is also supported with the use of no_proxy. Environment variables The http_proxy and https_proxy environment variables allow you to specify a proxy server for a given protocol. If you have it set on your system, it should work seamlessly. This is the simplest approach if a given protocol has only one proxy server and that proxy server doesn’t change. Proxy lists This approach allows you to specify one or more proxy servers for a protocol. If more than one proxy server is defined, ClickHouse uses the different proxies on a round-robin basis, balancing the load across the servers. This is the simplest approach if there is more than one proxy server for a protocol and the list of proxy servers doesn’t change. Configuration template
Select a parent field in the tabs below to view their children:
Remote proxy resolvers It’s possible that the proxy servers change dynamically. In that case, you can define the endpoint of a resolver. ClickHouse sends an empty GET request to that endpoint, the remote resolver should return the proxy host. ClickHouse will use it to form the proxy URI using the following template: \{proxy_scheme\}://\{proxy_host\}:{proxy_port} Configuration template
Select a parent field in the tabs below to view their children:
Precedence Proxy settings are determined in the following order: ClickHouse will check the highest priority resolver type for the request protocol. If it is not defined, it will check the next highest priority resolver type, until it reaches the environment resolver. This also allows a mix of resolver types can be used.

remap_executable

Setting to reallocate memory for machine code (“text”) using huge pages.
This feature is highly experimental.
Example

replica_group_name

Replica group name for database Replicated. The cluster created by Replicated database will consist of replicas in the same group. DDL queries will only wait for the replicas in the same group.
  • Default: ""
Example

replicated_merge_tree

Fine-tuning for tables in the ReplicatedMergeTree. This setting has a higher priority. For more information, see the MergeTreeSettings.h header file. Example

restore_threads

The maximum number of threads to execute RESTORE requests.

seccomp

What the Linux kernel does when the server makes a system call that it is not supposed to make. At startup the server installs a seccomp filter on itself, allowing only the system calls ClickHouse uses. An attacker who manages to run code inside the server process is then left without the kernel interfaces that turn code execution into something worse: loading kernel modules, rebooting, mounting filesystems, chroot, changing the process identity, creating namespaces, ptrace and reading another process’s memory, eBPF, the kernel keyring, userfaultfd and vmsplice, file handles, fanotify, swap and quota control, setting the system clock or the host name, and System V and POSIX message queues. The two requests of ioctl that let a process take over the terminal it holds, TIOCSTI and TIOCLINUX, are refused as well. The io_uring system calls are allowed, because local_filesystem_read_method = io_uring uses them, and the filter does not see the operations submitted through a ring - so the operations io_uring implements, such as the extended-attribute ones, stay reachable that way even though their system calls are refused. In every mode but disabled the server also sets PR_SET_NO_NEW_PRIVS, so that neither it nor anything it starts can gain privileges by running a setuid program. Creating a namespace is refused in every form it takes: unshare and setns are not allowed at all, a clone that asks for a namespace among its flags is refused, and clone3 - whose arguments live in a structure that a filter cannot read, so that a namespace cannot be told from a thread - is refused as a whole, with ENOSYS. That is how a libc discovers that it has to use clone instead, so making threads and processes keeps working; docker and systemd refuse clone3 the same way in their own policies. The extended-attribute system calls are refused with ENOSYS as well. ClickHouse does not use them, but the NSS modules of the host run inside the server process, and nss-resolve of systemd probes whether it may tag its socket with an attribute before doing so; ENOSYS is the answer it takes for “no” and goes on without the tag, whereas SIGSYS in the trap mode would terminate the server at the first host name lookup. Possible values:
  • trap - the kernel sends SIGSYS to the offending thread. ClickHouse treats it as any other fatal signal: the system call number and a stack trace go to the log, and the server terminates.
  • kill - the kernel kills the whole process at once. Nothing is written to the log, because no signal handler gets to run.
  • errno - the system call fails with EPERM and the server keeps running. Whatever made the call sees an error it most likely does not expect.
  • log - the system call is allowed, and only recorded. No system call is refused, so this mode enforces no policy at all; use it to check the policy against your workload before turning it on. PR_SET_NO_NEW_PRIVS is still set in this mode, because the kernel asks for it before it accepts a filter at all, so a setuid program the server runs does not get to elevate even here.
  • disabled - no filter is installed.
The default is log, so that the policy enforces nothing until it has been validated against a workload: run the server with it, watch the kernel audit log for a system call the policy does not cover, and only then switch the setting to trap, kill or errno. The configuration file shipped with the server packages and the Docker image sets it to trap. Where the kernel cannot install a filter with the log action - it predates Linux 4.14, it is built without CONFIG_SECCOMP_FILTER, or an outer sandbox such as a container runtime refuses the seccomp system call - the log mode logs a warning with the reason and the server runs without a filter, since there is nothing the filter would have enforced. PR_SET_NO_NEW_PRIVS is set all the same. The enforcing modes do not do that: if their filter cannot be installed, the server does not start. In every mode but disabled the kernel also records the offending system call in its audit log, naming the process and the system call number - which is the only evidence left behind in the kill mode, where the server does not get to write to its own log. A filter cannot be removed or relaxed once installed, and it is inherited across both fork and execve, so it also applies to executable dictionaries and executable user defined functions, to the library and ODBC bridges, and to the OOM canary. A script run by one of those is subject to the same policy, which is worth keeping in mind if it does something unusual. The policy is only implemented for x86-64 and AArch64, since it is a list of architecture-specific system call numbers. On any other architecture the server logs a warning at startup and runs without a filter, but PR_SET_NO_NEW_PRIVS, which does not depend on the architecture, is still set in every mode but disabled. seccomp is a facility of the Linux kernel: on other operating systems the server logs a warning at startup for any mode but disabled and runs without a filter. system.server_settings reports the mode of the filter in force, not the configured one: disabled wherever the server runs without a filter - on an operating system other than Linux, on an architecture without a policy, or in the log mode when the kernel cannot install its filter - and the mode set at startup otherwise, even after the configuration is reloaded with another value. Example

send_crash_reports

Settings for sending of crash reports to the ClickHouse core developers team. Enabling it, especially in pre-production environments, is highly appreciated. Keys: Recommended usage

series_keeper_path

Path in Keeper with auto-incremental numbers, generated by the generateSerialID function. Each series will be a node under this path.

ssh_server

The public part of the host key will be written to the known_hosts file on the SSH client side on the first connect. Host Key Configurations are inactive by default. Uncomment the host key configurations, and provide the path to the respective ssh key to active them: Example:

stream_kafka_locks_refresh_polls

Number of polls after which a Kafka consumer with offsets in Keeper re-checks which partitions it owns

table_engines_require_grant

If set to true, users require a grant to create a table with a specific engine e.g. GRANT TABLE ENGINE ON TinyLog to user.
  • Default: false
By default, for backward compatibility creating table with a specific table engine ignores grant, however you can change this behaviour by setting this to true.

tcp_ssh_port

Port for the SSH server which allows the user to connect and execute queries in an interactive fashion using the embedded client over the PTY. Example:

tcp_with_proxy_allow_interserver_mode

Allows clients connected through tcp_with_proxy_port to use the native protocol’s interserver mode. Disable this setting when tcp_with_proxy_port is exposed to untrusted clients through a proxy. Connections to tcp_port and tcp_port_secure are not affected.

text_log

Settings for the text_log system table for logging text messages. The following settings can be configured by sub-tags: All settings except database, table and engine can also be set once for all system log tables in the system_tables section. A setting inside a particular table’s section takes precedence, and a per-table engine replaces the whole engine definition, including the global partition_by, ttl, order_by, storage_policy and settings:
The system_tables section additionally accepts the following setting, which applies to all system log tables and cannot be set per table: The previous location of this setting, default_system_log_flush_policy.skip_alias_columns, is deprecated and is used only if system_tables.skip_alias_columns is not set. Additionally: Example

thread_pool_queue_size

The maximum number of jobs that can be scheduled on the Global Thread pool. Increasing queue size leads to larger memory usage. It is recommended to keep this value equal to max_thread_pool_size.
A value of 0 means unlimited.
Example

throw_on_unknown_workload

Defines behaviour on access to unknown WORKLOAD with query setting ‘workload’.
  • If true, RESOURCE_ACCESS_DENIED exception is thrown from a query that is trying to access unknown workload. Useful to enforce resource scheduling for all queries after WORKLOAD hierarchy is established and contains WORKLOAD default.
  • If false (default), unlimited access w/o resource scheduling is provided to a query with ‘workload’ setting pointing to unknown WORKLOAD. This is important during setting up hierarchy of WORKLOAD, before WORKLOAD default is added.
Example
See Also

timezone

The server’s time zone. Specified as a name that system.time_zones lists - the IANA Time Zone Database that is shipped with the server, for example Africa/Abidjan - or as a fixed offset from UTC, spelled Fixed/UTC±HH:MM:SS, for example Fixed/UTC+05:30:00. A name that only the operating system’s time zone database has is rejected, because ClickHouse ships its own copy of the database so that results do not depend on the host. The time zone is necessary for conversions between String and DateTime formats when DateTime fields are output to text format (printed on the screen or in a file), and when getting DateTime from a string. Besides, the time zone is used in functions that work with the time and date if they didn’t receive the time zone in the input parameters. Example
See also

trace_log

Settings for the trace_log system table operation. The following settings can be configured by sub-tags: All settings except database, table and engine can also be set once for all system log tables in the system_tables section. A setting inside a particular table’s section takes precedence, and a per-table engine replaces the whole engine definition, including the global partition_by, ttl, order_by, storage_policy and settings:
The system_tables section additionally accepts the following setting, which applies to all system log tables and cannot be set per table: The previous location of this setting, default_system_log_flush_policy.skip_alias_columns, is deprecated and is used only if system_tables.skip_alias_columns is not set. The default server configuration file config.xml contains the following settings section:

url_scheme_mappers

Configuration for translating shortened or symbolic URL prefixes into full URLs. Example:

validate_tcp_client_information

Determines whether validation of client information is enabled when a query packet is received. By default, it is false:

wait_dictionaries_load_at_startup

This setting allows to specify behavior if dictionaries_lazy_load is false. (If dictionaries_lazy_load is true this setting doesn’t affect anything.) If wait_dictionaries_load_at_startup is false, then the server will start loading all the dictionaries at startup and it will receive connections in parallel with that loading. When a dictionary is used in a query for the first time then the query will wait until the dictionary is loaded if it’s not loaded yet. Setting wait_dictionaries_load_at_startup to false can make ClickHouse start faster, however some queries can be executed slower (because they will have to wait for some dictionaries to be loaded). If wait_dictionaries_load_at_startup is true, then the server will wait at startup until all the dictionaries finish their loading (successfully or not) before receiving any connections. Example

webassembly_udf_engine

The engine used to execute WebAssembly UDFs. The only supported value is ‘wasmtime’.

webterminal_allowed_origins

Comma-separated list of full origins (scheme + host + optional port) allowed to open /webterminal WebSocket sessions. When empty, the same-origin policy is enforced strictly (Origin must match the request scheme, host, and port). Set this for deployments behind a TLS-terminating reverse proxy where request.isSecure() is false even though the browser uses https. Example: https://example.com,https://app.example.com:8443.