> ## Documentation Index
> Fetch the complete documentation index at: https://clickhouse.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# distributed_cache_* session settings

> ClickHouse session settings in the distributed_cache_* generated group.

These settings are available in [system.settings](https://clickhouse.com/docs/reference/system-tables/settings.md) and are autogenerated from [source](https://github.com/ClickHouse/ClickHouse/blob/master/src/Core/Settings.cpp).

## distributed\_cache\_alignment

Type

UInt64

Default

0

Only has an effect in ClickHouse Cloud. A setting for testing purposes, do not change it

## distributed\_cache\_bypass\_connection\_pool

Type

Bool

Default

0

Only has an effect in ClickHouse Cloud. Allow to bypass distributed cache connection pool

## distributed\_cache\_client\_id

Only has an effect in ClickHouse Cloud. A setting used only for CI tests - overrides the registry-configured distributed cache client id for this query's requests when non-empty. Lets tests spread data across a bounded set of client ids while keeping the same data on the same client id. It requires `ci_mode` to be enabled in the distributed cache client config: when it is not (the default, as in production), a query that routes a read or write through the distributed cache fails with `SUPPORT_IS_DISABLED` instead of silently falling back to the configured client id. Queries that never reach the distributed cache are unaffected, so the value is ignored there.

## distributed\_cache\_connect\_backoff\_max\_ms

Type

UInt64

Default

50

Only has an effect in ClickHouse Cloud. Maximum backoff milliseconds for distributed cache connection creation.

## distributed\_cache\_connect\_backoff\_min\_ms

Type

UInt64

Default

0

Only has an effect in ClickHouse Cloud. Minimum backoff milliseconds for distributed cache connection creation.

## distributed\_cache\_connect\_max\_tries

Type

UInt64

Default

5

Only has an effect in ClickHouse Cloud. Number of tries to connect to distributed cache if unsuccessful

## distributed\_cache\_connect\_timeout\_ms

Type

UInt64

Default

50

Only has an effect in ClickHouse Cloud. Connection timeout when connecting to distributed cache server.

## distributed\_cache\_credentials\_refresh\_period\_seconds

Type

UInt64

Default

5

Only has an effect in ClickHouse Cloud. A period of credentials refresh.

## distributed\_cache\_data\_packet\_ack\_window

Type

UInt64

Default

5

Only has an effect in ClickHouse Cloud. A window for sending ACK for DataPacket sequence in a single distributed cache read request

## distributed\_cache\_discard\_connection\_if\_unread\_data

Type

Bool

Default

1

Only has an effect in ClickHouse Cloud. Discard connection if some data is unread.

## distributed\_cache\_fetch\_metrics\_only\_from\_current\_az

Type

Bool

Default

1

Only has an effect in ClickHouse Cloud. Fetch metrics only from current availability zone in system.distributed\_cache\_metrics, system.distributed\_cache\_events

## distributed\_cache\_file\_cache\_name

Only has an effect in ClickHouse Cloud. A setting used only for CI tests - filesystem cache name to use on distributed cache.

## distributed\_cache\_log\_mode

Type

DistributedCacheLogMode

Default

on\_error

Only has an effect in ClickHouse Cloud. Mode for writing to system.distributed\_cache\_log

## distributed\_cache\_max\_unacked\_inflight\_packets

Type

UInt64

Default

10

Only has an effect in ClickHouse Cloud. A maximum number of unacknowledged in-flight packets in a single distributed cache read request

## distributed\_cache\_min\_bytes\_for\_seek

Type

UInt64

Default

0

Only has an effect in ClickHouse Cloud. Minimum number of bytes to do seek in distributed cache.

## distributed\_cache\_min\_inflight\_bytes\_to\_discard\_connection

Type

UInt64

Default

4194304

Only has an effect in ClickHouse Cloud. When a distributed cache read request is cancelled while data may still arrive, discard the connection if the estimated number of in-flight bytes exceeds this value; otherwise return it to the pool, and the next request on the connection drains them. 0 always discards the connection. On a seek, `distributed_cache_min_inflight_bytes_to_discard_connection_on_seek` first decides whether to re-request on the same connection; if the request is cancelled instead, this setting also applies. Unlike that setting, 0 here means "always discard". It has no effect if `distributed_cache_discard_connection_if_unread_data` is disabled, because the connection is then always kept.

## distributed\_cache\_min\_inflight\_bytes\_to\_discard\_connection\_on\_seek

Type

UInt64

Default

4194304

Only has an effect in ClickHouse Cloud. On a seek away from the current position of an open distributed cache stream, if the estimated number of in-flight bytes that would have to be discarded to keep reusing the connection (via the read range id mechanism) exceeds this value, drop the connection and open a new one instead. This avoids draining a large amount of unused data when seeks are frequent. 0 disables this and always reuses the connection.

## distributed\_cache\_pool\_behaviour\_on\_limit

Type

DistributedCachePoolBehaviourOnLimit

Default

wait

Only has an effect in ClickHouse Cloud. Identifies behaviour of distributed cache connection on pool limit reached

## distributed\_cache\_prefer\_bigger\_buffer\_size

Type

Bool

Default

0

Only has an effect in ClickHouse Cloud. Same as filesystem\_cache\_prefer\_bigger\_buffer\_size, but for distributed cache.

## distributed\_cache\_read\_only\_from\_current\_az

Type

Bool

Default

1

Only has an effect in ClickHouse Cloud. Allow to read only from current availability zone. If disabled, will read from all cache servers in all availability zones.

## distributed\_cache\_read\_request\_max\_tries

Type

UInt64

Default

10

Only has an effect in ClickHouse Cloud. Number of tries to do distributed cache read request if unsuccessful

## distributed\_cache\_receive\_response\_wait\_milliseconds

Type

UInt64

Default

60000

Only has an effect in ClickHouse Cloud. Wait time in milliseconds to receive data for request from distributed cache

## distributed\_cache\_receive\_timeout\_milliseconds

Type

UInt64

Default

10000

Only has an effect in ClickHouse Cloud. Wait time in milliseconds to receive any kind of response from distributed cache

Cloud default value: `20000`.

## distributed\_cache\_receive\_timeout\_ms

Type

UInt64

Default

3000

Only has an effect in ClickHouse Cloud. Timeout for receiving data from distributed cache server, in milliseconds. If no bytes were received in this interval, the exception is thrown.

## distributed\_cache\_registry\_show\_certificate\_and\_signature

Type

Bool

Default

0

Only has an effect in ClickHouse Cloud. Show the `certificate` and `signature` columns in the `system.distributed_cache_registry` table. By default these columns are empty to keep the output compact; enable this setting to inspect them.

## distributed\_cache\_send\_timeout\_ms

Type

UInt64

Default

3000

Only has an effect in ClickHouse Cloud. Timeout for sending data to distributed cache server, in milliseconds. If a client needs to send some data but is not able to send any bytes in this interval, the exception is thrown.

## distributed\_cache\_tcp\_keep\_alive\_timeout\_ms

Type

UInt64

Default

2900

Only has an effect in ClickHouse Cloud. The time in milliseconds the connection to distributed cache server needs to remain idle before TCP starts sending keepalive probes.

## distributed\_cache\_throw\_on\_error

Type

Bool

Default

0

Only has an effect in ClickHouse Cloud. Rethrow exception happened during communication with distributed cache or exception received from distributed cache. Otherwise fallback to skipping distributed cache on error

## distributed\_cache\_use\_clients\_cache\_for\_read

Type

Bool

Default

1

Only has an effect in ClickHouse Cloud. Use clients cache for read requests.

## distributed\_cache\_wait\_connection\_from\_pool\_milliseconds

Type

UInt64

Default

100

Only has an effect in ClickHouse Cloud. Wait time in milliseconds to receive connection from connection pool if distributed\_cache\_pool\_behaviour\_on\_limit is wait

## distributed\_cache\_write\_request\_max\_tries

Type

UInt64

Default

10

Only has an effect in ClickHouse Cloud. Number of tries to do distributed cache write request if unsuccessful
