> ## 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_background_* 세션 설정

> distributed_background_* 생성 그룹에 속한 ClickHouse 세션 설정입니다.

export const SettingsInfoBlock = ({type, default_value, changeable_without_restart}) => {
  return <div className="not-prose" style={{
    display: "flex",
    flexWrap: "wrap",
    alignItems: "baseline",
    columnGap: "0.5rem",
    rowGap: "0.125rem",
    margin: "0.375rem 0",
    fontSize: "0.8125rem",
    lineHeight: "1.125rem"
  }}>
      <div style={{
    fontWeight: 600,
    opacity: 0.72
  }}>유형</div>
      <div style={{
    overflowWrap: "anywhere"
  }}>{type}</div>
      <div style={{
    fontWeight: 600,
    opacity: 0.72,
    marginInlineStart: "0.5rem"
  }}>기본값</div>
      <div style={{
    overflowWrap: "anywhere"
  }}>{default_value}</div>
      {changeable_without_restart && <div style={{
    fontWeight: 600,
    opacity: 0.72,
    marginInlineStart: "0.5rem"
  }}>
          재시작 없이 변경 가능
        </div>}
      {changeable_without_restart && <div style={{
    overflowWrap: "anywhere"
  }}>
          {changeable_without_restart}
        </div>}
    </div>;
};

이러한 설정은 [system.settings](/docs/ko/reference/system-tables/settings)에서 확인할 수 있으며, [소스 코드](https://github.com/ClickHouse/ClickHouse/blob/master/src/Core/Settings.cpp)를 바탕으로 자동 생성됩니다.

<div id="distributed_background_insert_batch">
  ## distributed\_background\_insert\_batch
</div>

**별칭**: `distributed_directory_monitor_batch_inserts`

<SettingsInfoBlock type="Bool" default_value="0" />

삽입된 데이터를 배치로 전송할지 여부를 설정합니다.

배치 전송이 활성화되면 [분산](/docs/ko/reference/engines/table-engines/special/distributed) 테이블 엔진은 삽입된 데이터의 여러 파일을 각각 따로 전송하는 대신 한 번에 전송하려고 시도합니다. 배치 전송을 사용하면 server 및 네트워크 리소스를 더 효율적으로 활용할 수 있어 cluster 성능이 향상됩니다.

가능한 값:

* 1 — 활성화됨.
* 0 — 비활성화됨.

<div id="distributed_background_insert_max_sleep_time_ms">
  ## distributed\_background\_insert\_max\_sleep\_time\_ms
</div>

**별칭**: `distributed_directory_monitor_max_sleep_time_ms`

<SettingsInfoBlock type="Milliseconds" default_value="30000" />

[분산](/docs/ko/reference/engines/table-engines/special/distributed) 테이블 엔진이 데이터를 전송할 때의 최대 인터벌입니다. [distributed\_background\_insert\_sleep\_time\_ms](/docs/ko/reference/settings/session-settings/distributed-background#distributed_background_insert_sleep_time_ms) 설정에 지정된 인터벌이 지수적으로 증가하는 최대치를 제한합니다.

가능한 값:

* 밀리초 단위의 양의 정수.

<div id="distributed_background_insert_sleep_time_ms">
  ## distributed\_background\_insert\_sleep\_time\_ms
</div>

**별칭**: `distributed_directory_monitor_sleep_time_ms`

<SettingsInfoBlock type="Milliseconds" default_value="100" />

[분산](/docs/ko/reference/engines/table-engines/special/distributed) 테이블 엔진이 데이터를 전송할 때 사용하는 기본 인터벌입니다. 실제 인터벌은 오류가 발생하면 지수적으로 증가합니다.

가능한 값:

* 밀리초 단위의 양의 정수.

<div id="distributed_background_insert_split_batch_on_failure">
  ## distributed\_background\_insert\_split\_batch\_on\_failure
</div>

**별칭**: `distributed_directory_monitor_split_batch_on_failure`

<SettingsInfoBlock type="Bool" default_value="0" />

실패 시 배치를 분할하는 기능을 활성화/비활성화합니다.

경우에 따라 특정 배치를 원격 세그먼트로 전송하는 작업이, 이후의 복잡한 파이프라인(예: `GROUP BY`가 포함된 `MATERIALIZED VIEW`)에서 `Memory limit exceeded` 또는 이와 유사한 오류가 발생하여 실패할 수 있습니다. 이런 경우에는 재시도해도 도움이 되지 않으며, 해당 테이블의 분산 전송이 중단될 수 있습니다. 하지만 그 배치에 포함된 파일을 하나씩 전송하면 `INSERT`가 성공할 수 있습니다.

따라서 이 설정을 `1`로 지정하면 이러한 배치에 대해서는 배칭이 비활성화됩니다(즉, 실패한 배치에 대해 `distributed_background_insert_batch`를 일시적으로 비활성화합니다).

가능한 값:

* 1 — 활성화됨.
* 0 — 비활성화됨.

<Note>
  이 설정은 손상된 배치에도 영향을 미칩니다(비정상적인 server(머신) 종료가 발생하고, [분산](/docs/ko/reference/engines/table-engines/special/distributed) 테이블 엔진에서 `fsync_after_insert`/`fsync_directories`를 사용하지 않는 경우 이러한 배치가 생길 수 있습니다).
</Note>

<Note>
  자동 배치 분할은 성능에 악영향을 줄 수 있으므로 이에 의존하지 마십시오.
</Note>

<div id="distributed_background_insert_timeout">
  ## distributed\_background\_insert\_timeout
</div>

**별칭**: `insert_distributed_timeout`

<SettingsInfoBlock type="UInt64" default_value="0" />

분산 테이블에 데이터를 삽입하는 쿼리의 제한 시간입니다. 이 설정은 `insert_distributed_sync`가 활성화된 경우에만 사용됩니다. 값이 0이면 제한 시간이 없습니다.
