Server Settings

## bcrypt\_workfactor[​](#bcrypt_workfactor "Direct link to bcrypt_workfactor")

Work factor for the `bcrypt_password` authentication type which uses the [Bcrypt algorithm](https://wildlyinaccurate.com/bcrypt-choosing-a-work-factor/).
The work factor defines the amount of computations and time needed to compute the hash and verify the password.

```
<bcrypt_workfactor>12</bcrypt_workfactor>
```

Note

For applications with high-frequency authentication,
consider alternative authentication methods due to
bcrypt's computational overhead at higher work factors.

## blob\_storage\_log[​](#blob_storage_log "Direct link to blob_storage_log")

Settings for the [`blob_storage_log`](/docs/operations/system-tables/blob_storage_log) system table.

The following settings can be configured by sub-tags:

|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| Setting Description Default Note|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | | `database` Name of the database. |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | | `table` Name of the system table. |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | | `engine` [MergeTree Engine Definition](/docs/engines/table-engines/mergetree-family/mergetree#table_engine-mergetree-creating-a-table) for a system table. Cannot be used if `partition_by` or `order_by` defined. If not specified `MergeTree` is selected by default| `partition_by` [Custom partitioning key](/docs/engines/table-engines/mergetree-family/custom-partitioning-key) for a system table. If `engine` is specified for system table, `partition_by` parameter should be specified directly inside 'engine'| `ttl` Specifies the table [TTL](/docs/engines/table-engines/mergetree-family/mergetree#table_engine-mergetree-ttl). If `engine` is specified for system table, `ttl` parameter should be specified directly inside 'engine'| `order_by` [Custom sorting key](/docs/engines/table-engines/mergetree-family/mergetree#order_by) for a system table. Can't be used if `engine` defined. If `engine` is specified for system table, `order_by` parameter should be specified directly inside 'engine'| `storage_policy` Name of the storage policy to use for the table (optional). If `engine` is specified for system table, `storage_policy` parameter should be specified directly inside 'engine'| `settings` [Additional parameters](/docs/engines/table-engines/mergetree-family/mergetree#settings) that control the behavior of the MergeTree (optional). If `engine` is specified for system table, `settings` parameter should be specified directly inside 'engine'| `flush_interval_milliseconds` Interval for flushing data from the buffer in memory to the table. `7500` |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | | `max_size_rows` Maximal size in lines for the logs. When the amount of non-flushed logs reaches the max\_size, logs are dumped to the disk. `1048576` |  |  |  |  |  |  |  |  |  |  |  |  | | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | | `reserved_size_rows` Pre-allocated memory size in lines for the logs. `8192` |  |  |  |  |  |  |  |  | | --- | --- | --- | --- | --- | --- | --- | --- | | `buffer_size_rows_flush_threshold` Threshold for amount of lines. If the threshold is reached, flushing logs to the disk is launched in background. `max_size_rows / 2` |  |  |  |  | | --- | --- | --- | --- | | `flush_on_crash` Sets whether logs should be dumped to the disk in case of a crash. `false`  | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |

Example:

```
<blob_storage_log>
    <database>system</database
    <table>blob_storage_log</table
    <partition_by>toYYYYMM(event_date)</partition_by>
    <flush_interval_milliseconds>7500</flush_interval_milliseconds
    <ttl>event_date + INTERVAL 30 DAY</ttl>
</blob_storage_log>
```

## builtin\_dictionaries\_reload\_interval[​](#builtin_dictionaries_reload_interval "Direct link to 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**

```
<builtin_dictionaries_reload_interval>3600</builtin_dictionaries_reload_interval>
```

## cache\_size\_to\_ram\_max\_ratio[​](#cache_size_to_ram_max_ratio "Direct link to 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[​](#cannot_allocate_thread_fault_injection_probability "Direct link to cannot_allocate_thread_fault_injection_probability")

For testing purposes.

## cgroups\_memory\_usage\_observer\_wait\_time[​](#cgroups_memory_usage_observer_wait_time "Direct link to 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`.

## compiled\_expression\_cache\_elements\_size[​](#compiled_expression_cache_elements_size "Direct link to compiled_expression_cache_elements_size")

Sets the cache size (in elements) for [compiled expressions](/docs/operations/caches).

## compiled\_expression\_cache\_size[​](#compiled_expression_cache_size "Direct link to compiled_expression_cache_size")

Sets the cache size (in bytes) for [compiled expressions](/docs/operations/caches).

## compression[​](#compression "Direct link to compression")

Data compression settings for [MergeTree](/docs/engines/table-engines/mergetree-family/mergetree)-engine tables.

Note

We recommend not changing this if you have just started using ClickHouse.

**Configuration template**:

```
<compression>
    <case>
      <min_part_size>...</min_part_size>
      <min_part_size_ratio>...</min_part_size_ratio>
      <method>...</method>
      <level>...</level>
    </case>
    ...
</compression>
```

**`<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](/docs/sql-reference/statements/create/table#general-purpose-codecs).

Note

You can configure multiple `<case>` sections.

**Actions when conditions are met**: