Server Settings

Use originating address for authentication for clients connected through proxy.

Note

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.

## background\_buffer\_flush\_schedule\_pool\_size[​](#background_buffer_flush_schedule_pool_size "Direct link to background_buffer_flush_schedule_pool_size")

The maximum number of threads that will be used for performing flush operations for [Buffer-engine tables](/docs/engines/table-engines/special/buffer) in the background.

## background\_common\_pool\_size[​](#background_common_pool_size "Direct link to background_common_pool_size")

The maximum number of threads that will be used for performing a variety of operations (mostly garbage collection) for [\*MergeTree-engine](/docs/engines/table-engines/mergetree-family) tables in the background.

## background\_distributed\_schedule\_pool\_size[​](#background_distributed_schedule_pool_size "Direct link to background_distributed_schedule_pool_size")

The maximum number of threads that will be used for executing distributed sends.

## background\_fetches\_pool\_size[​](#background_fetches_pool_size "Direct link to background_fetches_pool_size")

The maximum number of threads that will be used for fetching data parts from another replica for [\*MergeTree-engine](/docs/engines/table-engines/mergetree-family) tables in the background.

## background\_merges\_mutations\_concurrency\_ratio[​](#background_merges_mutations_concurrency_ratio "Direct link to background_merges_mutations_concurrency_ratio")

Sets a ratio between the number of threads and the number of background merges and mutations that can be executed concurrently.

For example, if the ratio equals to 2 and [`background_pool_size`](/docs/operations/server-configuration-parameters/settings#background_pool_size) is set to 16 then ClickHouse can execute 32 background merges concurrently. This is possible, because background operations could be suspended and postponed. This is needed to give small merges more execution priority.

Note

You can only increase this ratio at runtime. To lower it you have to restart the server.

As with the [`background_pool_size`](/docs/operations/server-configuration-parameters/settings#background_pool_size) setting [`background_merges_mutations_concurrency_ratio`](/docs/operations/server-configuration-parameters/settings#background_merges_mutations_concurrency_ratio) could be applied from the `default` profile for backward compatibility.

## background\_merges\_mutations\_scheduling\_policy[​](#background_merges_mutations_scheduling_policy "Direct link to background_merges_mutations_scheduling_policy")

The policy on how to perform a scheduling for background merges and mutations. Possible values are: `round_robin` and `shortest_task_first`.

Algorithm used to select next merge or mutation to be executed by background thread pool. Policy may be changed at runtime without server restart.
Could be applied from the `default` profile for backward compatibility.

Possible values:

- `round_robin` — Every concurrent merge and mutation is executed in round-robin order to ensure starvation-free operation. Smaller merges are completed faster than bigger ones just because they have fewer blocks to merge.
- `shortest_task_first` — Always execute smaller merge or mutation. Merges and mutations are assigned priorities based on their resulting size. Merges with smaller sizes are strictly preferred over bigger ones. This policy ensures the fastest possible merge of small parts but can lead to indefinite starvation of big merges in partitions heavily overloaded by `INSERT`s.

## background\_message\_broker\_schedule\_pool\_size[​](#background_message_broker_schedule_pool_size "Direct link to background_message_broker_schedule_pool_size")

The maximum number of threads that will be used for executing background operations for message streaming.

## background\_move\_pool\_size[​](#background_move_pool_size "Direct link to background_move_pool_size")

The maximum number of threads that will be used for moving data parts to another disk or volume for \*MergeTree-engine tables in a background.

## background\_pool\_size[​](#background_pool_size "Direct link to background_pool_size")

Sets the number of threads performing background merges and mutations for tables with MergeTree engines.

Note

- This setting could also be applied at server startup from the `default` profile configuration for backward compatibility at the ClickHouse server start.
- You can only increase the number of threads at runtime.
- To lower the number of threads you have to restart the server.
- By adjusting this setting, you manage CPU and disk load.

Danger

Smaller pool size utilizes less CPU and disk resources, but background processes advance slower which might eventually impact query performance.

Before changing it, please also take a look at related MergeTree settings, such as:

- [`number_of_free_entries_in_pool_to_lower_max_size_of_merge`](/docs/operations/settings/merge-tree-settings#number_of_free_entries_in_pool_to_lower_max_size_of_merge).
- [`number_of_free_entries_in_pool_to_execute_mutation`](/docs/operations/settings/merge-tree-settings#number_of_free_entries_in_pool_to_execute_mutation).
- [`number_of_free_entries_in_pool_to_execute_optimize_entire_partition`](/docs/operations/settings/merge-tree-settings#number_of_free_entries_in_pool_to_execute_optimize_entire_partition)

**Example**

```
<background_pool_size>16</background_pool_size>
```

## background\_schedule\_pool\_log[​](#background_schedule_pool_log "Direct link to background_schedule_pool_log")

Contains information about all background tasks that are executed via various background pools.

```
<background_schedule_pool_log>
    <database>system</database>
    <table>background_schedule_pool_log</table>
    <partition_by>toYYYYMM(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>
    <!-- Only tasks longer than duration_threshold_milliseconds will be logged. Zero means log everything -->
    <duration_threshold_milliseconds>0</duration_threshold_milliseconds>
</background_schedule_pool_log>
```

## background\_schedule\_pool\_max\_parallel\_tasks\_per\_type\_ratio[​](#background_schedule_pool_max_parallel_tasks_per_type_ratio "Direct link to background_schedule_pool_max_parallel_tasks_per_type_ratio")

The maximum ratio of threads in the pool that can execute tasks of the same type simultaneously.

## background\_schedule\_pool\_size[​](#background_schedule_pool_size "Direct link to background_schedule_pool_size")

The maximum number of threads that will be used for constantly executing some lightweight periodic operations for replicated tables, Kafka streaming, and DNS cache updates.

## backup\_log[​](#backup_log "Direct link to backup_log")

Settings for the [backup\_log](/docs/operations/system-tables/backup_log) system table for logging `BACKUP` and `RESTORE` operations.

The following settings can be configured by sub-tags: