Server Settings

The sub-tags above define the following settings for `disks`:

|  |  |  |  |  |  |  |  |
| --- | --- | --- | --- | --- | --- | --- | --- |
| Setting Description|  |  |  |  |  |  | | --- | --- | --- | --- | --- | --- | | `<disk_name_N>` The name of the disk, which should be unique.|  |  |  |  | | --- | --- | --- | --- | | `path` The path to which server data will be stored (`data` and `shadow` catalogues). It should end with `/`| `keep_free_space_bytes` Size of the reserved free space on disk. | | | | | | | |

Note

The order of the disks does not matter.

### Configuration of policies[​](#configuration-of-policies "Direct link to Configuration of policies")

The sub-tags above define the following settings for `policies`:

|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| Setting Description|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | | `policy_name_N` Name of the policy. Policy names must be unique.|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | | `volume_name_N` The volume name. Volume names must be unique.|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | | `disk` The disk located inside the volume.|  |  |  |  |  |  |  |  |  |  |  |  |  |  | | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | | `max_data_part_size_bytes` The maximum size of a chunk of data that can reside on any of the disks in this volume. If the merge results in a chunk size expected to be larger than max\_data\_part\_size\_bytes, the chunk will be written to the next volume. Basically this feature allows you to store new / small chunks on a hot (SSD) volume and move them to a cold (HDD) volume when they reach a large size. Do not use this option if the policy has only one volume.|  |  |  |  |  |  |  |  |  |  |  |  | | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | | `move_factor` The share of available free space on the volume. If the space becomes less, the data will start transferring to the next volume, if there is one. For transfer, chunks are sorted by size from larger to smaller (descending) and chunks whose total size is sufficient to meet the `move_factor` condition are selected, if the total size of all chunks is insufficient, all chunks will be moved.| `perform_ttl_move_on_insert` Disables moving data with expired TTL on insertion. By default (if enabled), if we insert a piece of data that has already expired according to the move on life rule, it is immediately moved to the volume / disk specified in the move rule. This can significantly slow down insertion in case the target volume / disk is slow (e.g. S3). If disabled, the expired portion of the data is written to the default volume and then immediately moved to the volume specified in the rule for the expired TTL.|  |  |  |  |  |  |  |  | | --- | --- | --- | --- | --- | --- | --- | --- | | `load_balancing` Disk balancing policy, `round_robin` or `least_used`.| `least_used_ttl_ms` Sets the timeout (in milliseconds) to update the available space on all disks (`0` - always update, `-1` - never update, default value is `60000`). Note, if the disk is only used by ClickHouse and will not be subject to file system resizing on the fly, you can use the `-1` value. In all other cases this is not recommended, as it will eventually lead to incorrect space allocation.| `prefer_not_to_merge` Disables merging parts of the data on this volume. Note: this is potentially harmful and can cause slowdown. When this setting is enabled (don't do this), merging data on this volume is prohibited (which is bad). This allows control of how ClickHouse interacts with slow disks. We recommend not to use this at all.|  |  | | --- | --- | | `volume_priority` Defines the priority (order) in which volumes are filled. The smaller the value, the higher the priority. The parameter values must be natural numbers and cover the range from 1 to N (N is the largest parameter value specified) with no gaps. | | | | | | | | | | | | | | | | | | | | | |

For the `volume_priority`:

- If all volumes have this parameter, they are prioritized in the specified order.
- If only *some* volumes have it, volumes that do not have it have the lowest priority. Those that do have it are prioritized according to the tag value, the priority of the rest is determined by the order of description in the configuration file relative to each other.
- If *no* volumes are given this parameter, their order is determined by the order of the description in the configuration file.
- The priority of volumes may not be identical.

## storage\_connections\_hard\_limit[​](#storage_connections_hard_limit "Direct link to storage_connections_hard_limit")

Exception is thrown at a creation attempt when this limit is reached. Set to 0 to turn off hard limitation. The limit applies to the storages connections.

## storage\_connections\_soft\_limit[​](#storage_connections_soft_limit "Direct link to storage_connections_soft_limit")

Connections above this limit have significantly shorter time to live. The limit applies to the storages connections.

## storage\_connections\_store\_limit[​](#storage_connections_store_limit "Direct link to storage_connections_store_limit")

Connections above this limit reset after use. Set to 0 to turn connection cache off. The limit applies to the storages connections.

## storage\_connections\_warn\_limit[​](#storage_connections_warn_limit "Direct link to storage_connections_warn_limit")

Warning massages are written to the logs if number of in-use connections are higher than this limit. The limit applies to the storages connections.

## storage\_metadata\_write\_full\_object\_key[​](#storage_metadata_write_full_object_key "Direct link to storage_metadata_write_full_object_key")

Write disk metadata files with VERSION\_FULL\_OBJECT\_KEY format. This is enabled by default. The setting is deprecated.

## storage\_shared\_set\_join\_use\_inner\_uuid[​](#storage_shared_set_join_use_inner_uuid "Direct link to storage_shared_set_join_use_inner_uuid")

If enabled, an inner UUID is generated during the creation of SharedSet and SharedJoin. ClickHouse Cloud only

## table\_engines\_require\_grant[​](#table_engines_require_grant "Direct link to 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`.

Note

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.

## tables\_loader\_background\_pool\_size[​](#tables_loader_background_pool_size "Direct link to tables_loader_background_pool_size")

Sets the number of threads performing asynchronous load jobs in background pool. The background pool is used for loading tables asynchronously after server start in case there are no queries waiting for the table. It could be beneficial to keep low number of threads in background pool if there are a lot of tables. It will reserve CPU resources for concurrent query execution.

Note

A value of `0` means all available CPUs will be used.

## tables\_loader\_foreground\_pool\_size[​](#tables_loader_foreground_pool_size "Direct link to tables_loader_foreground_pool_size")

Sets the number of threads performing load jobs in foreground pool. The foreground pool is used for loading table synchronously before server start listening on a port and for loading tables that are waited for. Foreground pool has higher priority than background pool. It means that no job starts in background pool while there are jobs running in foreground pool.

Note

A value of `0` means all available CPUs will be used.