Server Settings

Fraction of the memory limit to keep free from the userspace page cache. Analogous to Linux min\_free\_kbytes setting.

## page\_cache\_history\_window\_ms[​](#page_cache_history_window_ms "Direct link to page_cache_history_window_ms")

Delay before freed memory can be used by userspace page cache.

## page\_cache\_max\_size[​](#page_cache_max_size "Direct link to page_cache_max_size")

Maximum size of the userspace page cache. Set to 0 to disable the cache. If greater than page\_cache\_min\_size, the cache size will be continuously adjusted within this range, to use most of the available memory while keeping the total memory usage below the limit (max\_server\_memory\_usage[\_to\_ram\_ratio]).

## page\_cache\_min\_size[​](#page_cache_min_size "Direct link to page_cache_min_size")

Minimum size of the userspace page cache.

## page\_cache\_policy[​](#page_cache_policy "Direct link to page_cache_policy")

Userspace page cache policy name.

## page\_cache\_shards[​](#page_cache_shards "Direct link to page_cache_shards")

Stripe userspace page cache over this many shards to reduce mutex contention. Experimental, not likely to improve performance.

## page\_cache\_size\_ratio[​](#page_cache_size_ratio "Direct link to page_cache_size_ratio")

The size of the protected queue in the userspace page cache relative to the cache's total size.

## parquet\_metadata\_cache\_max\_entries[​](#parquet_metadata_cache_max_entries "Direct link to parquet_metadata_cache_max_entries")

Maximum size of parquet metadata files cache in entries. Zero means disabled.

## parquet\_metadata\_cache\_policy[​](#parquet_metadata_cache_policy "Direct link to parquet_metadata_cache_policy")

Parquet metadata cache policy name.

## parquet\_metadata\_cache\_size[​](#parquet_metadata_cache_size "Direct link to parquet_metadata_cache_size")

Maximum size of parquet metadata cache in bytes. Zero means disabled.

## parquet\_metadata\_cache\_size\_ratio[​](#parquet_metadata_cache_size_ratio "Direct link to parquet_metadata_cache_size_ratio")

The size of the protected queue (in case of SLRU policy) in the parquet metadata cache relative to the cache's total size.

## part\_log[​](#part_log "Direct link to part_log")

Logging events that are associated with [MergeTree](/docs/engines/table-engines/mergetree-family/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](/docs/operations/system-tables/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:

|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| 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**

```
<part_log>
    <database>system</database>
    <table>part_log</table>
    <partition_by>toMonday(event_date)</partition_by>
    <flush_interval_milliseconds>7500</flush_interval_milliseconds>
    <max_size_rows>1048576</max_size_rows>
    <reserved_size_rows>8192</reserved_size_rows>
    <buffer_size_rows_flush_threshold>524288</buffer_size_rows_flush_threshold>
    <flush_on_crash>false</flush_on_crash>
</part_log>
```

## parts\_kill\_delay\_period[​](#parts_kill_delay_period "Direct link to parts_kill_delay_period")

Period to completely remove parts for SharedMergeTree. Only available in ClickHouse Cloud

## parts\_kill\_delay\_period\_random\_add[​](#parts_kill_delay_period_random_add "Direct link to parts_kill_delay_period_random_add")

Add uniformly distributed value from 0 to x seconds to kill\_delay\_period to avoid thundering herd effect and subsequent DoS of ZooKeeper in case of very large number of tables. Only available in ClickHouse Cloud