Server Settings

## max\_keep\_alive\_requests[​](#max_keep_alive_requests "Direct link to max_keep_alive_requests")

Maximal number of requests through a single keep-alive connection until it will be closed by ClickHouse server.

**Example**

```
<max_keep_alive_requests>10</max_keep_alive_requests>
```

## max\_local\_read\_bandwidth\_for\_server[​](#max_local_read_bandwidth_for_server "Direct link to max_local_read_bandwidth_for_server")

The maximum speed of local reads in bytes per second.

Note

A value of `0` means unlimited.

## max\_local\_write\_bandwidth\_for\_server[​](#max_local_write_bandwidth_for_server "Direct link to max_local_write_bandwidth_for_server")

The maximum speed of local writes in bytes per seconds.

Note

A value of `0` means unlimited.

## max\_materialized\_views\_count\_for\_table[​](#max_materialized_views_count_for_table "Direct link to max_materialized_views_count_for_table")

A limit on the number of materialized views attached to a table.

Note

Only directly dependent views are considered here, and the creation of one view on top of another view is not considered.

## max\_merges\_bandwidth\_for\_server[​](#max_merges_bandwidth_for_server "Direct link to max_merges_bandwidth_for_server")

The maximum read speed of all merges on server in bytes per second. Zero means unlimited.

## max\_mutations\_bandwidth\_for\_server[​](#max_mutations_bandwidth_for_server "Direct link to max_mutations_bandwidth_for_server")

The maximum read speed of all mutations on server in bytes per second. Zero means unlimited.

## max\_named\_collection\_num\_to\_throw[​](#max_named_collection_num_to_throw "Direct link to max_named_collection_num_to_throw")

If number of named collections is greater than this value, server will throw an exception.

Note

A value of `0` means no limitation.

**Example**

```
<max_named_collection_num_to_throw>400</max_named_collection_num_to_throw>
```

## max\_named\_collection\_num\_to\_warn[​](#max_named_collection_num_to_warn "Direct link to max_named_collection_num_to_warn")

If the number of named collections exceeds the specified value, clickhouse server will add warning messages to `system.warnings` table.

**Example**

```
<max_named_collection_num_to_warn>400</max_named_collection_num_to_warn>
```

## max\_open\_files[​](#max_open_files "Direct link to max_open_files")

The maximum number of open files.

Note

We recommend using this option in macOS since the getrlimit() function returns an incorrect value.

## max\_os\_cpu\_wait\_time\_ratio\_to\_drop\_connection[​](#max_os_cpu_wait_time_ratio_to_drop_connection "Direct link to max_os_cpu_wait_time_ratio_to_drop_connection")

Max ratio between OS CPU wait (OSCPUWaitMicroseconds metric) and busy (OSCPUVirtualTimeMicroseconds metric) times to consider dropping connections. Linear interpolation between min and max ratio is used to calculate the probability, the probability is 1 at this point.
See [Controlling behavior on server CPU overload](/docs/operations/settings/server-overload) for more details.

## max\_outdated\_parts\_loading\_thread\_pool\_size[​](#max_outdated_parts_loading_thread_pool_size "Direct link to max_outdated_parts_loading_thread_pool_size")

The number of threads to load inactive set of data parts (Outdated ones) at startup.

## max\_part\_num\_to\_warn[​](#max_part_num_to_warn "Direct link to max_part_num_to_warn")

If the number of active parts exceeds the specified value, clickhouse server will add warning messages to `system.warnings` table.

**Example**

```
<max_part_num_to_warn>400</max_part_num_to_warn>
```

## max\_partition\_size\_to\_drop[​](#max_partition_size_to_drop "Direct link to max_partition_size_to_drop")

Restriction on dropping partitions.

If the size of a [MergeTree](/docs/engines/table-engines/mergetree-family/mergetree) table exceeds [`max_partition_size_to_drop`](#max_partition_size_to_drop) (in bytes), you can't drop a partition using a [DROP PARTITION](/docs/sql-reference/statements/alter/partition#drop-partitionpart) query.
This setting does not require a restart of the ClickHouse server to apply. Another way to disable the restriction is to create the `<clickhouse-path>/flags/force_drop_table` file.

Note

The value `0` means that you can drop partitions without any restrictions.

This limitation does not restrict drop table and truncate table, see [max\_table\_size\_to\_drop](/docs/operations/settings/settings#max_table_size_to_drop)

**Example**

```
<max_partition_size_to_drop>0</max_partition_size_to_drop>
```

## max\_parts\_cleaning\_thread\_pool\_size[​](#max_parts_cleaning_thread_pool_size "Direct link to max_parts_cleaning_thread_pool_size")

The number of threads for concurrent removal of inactive data parts.

## max\_pending\_mutations\_execution\_time\_to\_warn[​](#max_pending_mutations_execution_time_to_warn "Direct link to max_pending_mutations_execution_time_to_warn")

If any of the pending mutations exceeds the specified value in seconds, clickhouse server will add warning messages to `system.warnings` table.

**Example**

```
<max_pending_mutations_execution_time_to_warn>10000</max_pending_mutations_execution_time_to_warn>
```

## max\_pending\_mutations\_to\_warn[​](#max_pending_mutations_to_warn "Direct link to max_pending_mutations_to_warn")

If the number of pending mutations exceeds the specified value, clickhouse server will add warning messages to `system.warnings` table.

**Example**

```
<max_pending_mutations_to_warn>400</max_pending_mutations_to_warn>
```

## max\_prefixes\_deserialization\_thread\_pool\_free\_size[​](#max_prefixes_deserialization_thread_pool_free_size "Direct link to max_prefixes_deserialization_thread_pool_free_size")

If the number of **idle** threads in the prefixes deserialization Thread pool exceeds `max_prefixes_deserialization_thread_pool_free_size`, ClickHouse will release resources occupied by idling threads and decrease the pool size. Threads can be created again if necessary.

## max\_prefixes\_deserialization\_thread\_pool\_size[​](#max_prefixes_deserialization_thread_pool_size "Direct link to max_prefixes_deserialization_thread_pool_size")

ClickHouse uses threads from the prefixes deserialization Thread pool for parallel reading of metadata of columns and subcolumns from file prefixes in Wide parts in MergeTree. `max_prefixes_deserialization_thread_pool_size` limits the maximum number of threads in the pool.

## max\_remote\_read\_network\_bandwidth\_for\_server[​](#max_remote_read_network_bandwidth_for_server "Direct link to max_remote_read_network_bandwidth_for_server")

The maximum speed of data exchange over the network in bytes per second for read.

Note

A value of `0` (default) means unlimited.

## max\_remote\_write\_network\_bandwidth\_for\_server[​](#max_remote_write_network_bandwidth_for_server "Direct link to max_remote_write_network_bandwidth_for_server")

The maximum speed of data exchange over the network in bytes per second for write.

Note

A value of `0` (default) means unlimited.

## max\_replicated\_fetches\_network\_bandwidth\_for\_server[​](#max_replicated_fetches_network_bandwidth_for_server "Direct link to max_replicated_fetches_network_bandwidth_for_server")

The maximum speed of data exchange over the network in bytes per second for replicated fetches. Zero means unlimited.

## max\_replicated\_sends\_network\_bandwidth\_for\_server[​](#max_replicated_sends_network_bandwidth_for_server "Direct link to max_replicated_sends_network_bandwidth_for_server")

The maximum speed of data exchange over the network in bytes per second for replicated sends. Zero means unlimited.

## max\_replicated\_table\_num\_to\_throw[​](#max_replicated_table_num_to_throw "Direct link to max_replicated_table_num_to_throw")

If the number of replicated tables is greater than this value, the server will throw an exception.

Only counts tables for database engines:

- Atomic
- Ordinary
- Replicated
- Lazy

Note

A value of `0` means no limitation.

**Example**

```
<max_replicated_table_num_to_throw>400</max_replicated_table_num_to_throw>
```

## max\_server\_memory\_usage[​](#max_server_memory_usage "Direct link to max_server_memory_usage")