> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-parallel-read-in-order-multi-part.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# s3_* session settings

> ClickHouse session settings in the s3_* generated group.

export const VersionHistory = ({rows = []}) => {
  if (rows.length === 0) {
    return null;
  }
  const headers = ["Version", "Default value", "Comment"];
  const border = "1px solid rgba(128, 128, 128, 0.3)";
  const cell = {
    border,
    padding: "0.25rem 0.5rem",
    textAlign: "start",
    verticalAlign: "top"
  };
  return <details className="not-prose" style={{
    border,
    borderRadius: "0.5rem",
    margin: "0.5rem 0",
    padding: "0.5rem 0.75rem",
    fontSize: "0.8125rem",
    lineHeight: "1.125rem"
  }}>
      <summary style={{
    cursor: "pointer",
    fontWeight: 600,
    opacity: 0.72
  }}>
        Version history
      </summary>
      <table style={{
    borderCollapse: "collapse",
    width: "100%",
    margin: "0.5rem 0 0"
  }}>
        <thead>
          <tr>
            {headers.map(header => <th key={header} style={{
    ...cell,
    fontWeight: 600,
    opacity: 0.72
  }}>
                {header}
              </th>)}
          </tr>
        </thead>
        <tbody>
          {rows.map((row, row_index) => <tr key={row.id ?? row_index}>
              {(row.items ?? []).map((item, item_index) => <td key={item_index} style={{
    ...cell,
    overflowWrap: "anywhere"
  }}>
                  {item?.label}
                </td>)}
            </tr>)}
        </tbody>
      </table>
    </details>;
};

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
  }}>Type</div>
      <div style={{
    overflowWrap: "anywhere"
  }}>{type}</div>
      <div style={{
    fontWeight: 600,
    opacity: 0.72,
    marginInlineStart: "0.5rem"
  }}>Default</div>
      <div style={{
    overflowWrap: "anywhere"
  }}>{default_value}</div>
      {changeable_without_restart && <div style={{
    fontWeight: 600,
    opacity: 0.72,
    marginInlineStart: "0.5rem"
  }}>
          Changeable without restart
        </div>}
      {changeable_without_restart && <div style={{
    overflowWrap: "anywhere"
  }}>
          {changeable_without_restart}
        </div>}
    </div>;
};

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

<h2 id="s3_base">
  s3\_base
</h2>

<VersionHistory rows={[{"id": "row-1","items": [{"label": "26.8"},{"label": ""},{"label": "New setting to specify the base URL for resolving relative URLs in the s3 table function and the S3 table engine."}]}]} />

The base URL used to resolve relative URLs in the [s3](/reference/functions/table-functions/s3) table function and the [S3](/reference/engines/table-engines/integrations/s3) table engine, as well as in the table functions that share their configuration (`s3Cluster`, `gcs`, `oss`).

When set, a URL without a scheme is resolved against `s3_base` per RFC 3986, using the same rules as [url\_base](/reference/settings/session-settings/url#url_base). URLs that already contain a scheme are used as-is.

For example, if `s3_base` is `s3://clickhouse-public-datasets/`, then `s3('hits_compatible/hits.csv')` reads `s3://clickhouse-public-datasets/hits_compatible/hits.csv`.

The base URL can use any form accepted by the `s3` table function, e.g. `s3://bucket/`, `https://bucket.s3.amazonaws.com/` or `https://endpoint/bucket/`.

When the relative URL comes from a [named collection](/concepts/features/configuration/server-config/named-collections), resolving it counts as an override of the `url` key of the collection and requires the `SHOW NAMED COLLECTIONS SECRETS` privilege on that collection.

<h2 id="s3_check_objects_after_upload">
  s3\_check\_objects\_after\_upload
</h2>

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

Check each uploaded object to s3 with head request to be sure that upload was successful

<h2 id="s3_connect_timeout_ms">
  s3\_connect\_timeout\_ms
</h2>

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

<VersionHistory rows={[{"id": "row-1","items": [{"label": "24.3"},{"label": "1000"},{"label": "Introduce new dedicated setting for s3 connection timeout"}]}]} />

Connection timeout for host from s3 disks.

<h2 id="s3_create_new_file_on_insert">
  s3\_create\_new\_file\_on\_insert
</h2>

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

Enables or disables creating a new file on each insert in s3 engine tables. If enabled, on each insert a new S3 object will be created with the key, similar to this pattern:

initial: `data.Parquet.gz` -> `data.1.Parquet.gz` -> `data.2.Parquet.gz`, etc.

Possible values:

* 0 — `INSERT` query creates a new file or fail if file exists and s3\_truncate\_on\_insert is not set.
* 1 — `INSERT` query creates a new file on each insert using suffix (from the second one) if s3\_truncate\_on\_insert is not set.

See more details [here](/integrations/connectors/data-ingestion/AWS/integrating-s3-with-clickhouse#inserting-data).

<h2 id="s3_ignore_file_doesnt_exist">
  s3\_ignore\_file\_doesnt\_exist
</h2>

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

<VersionHistory rows={[{"id": "row-1","items": [{"label": "24.6"},{"label": "0"},{"label": "Allow to return 0 rows when the requested files don't exist instead of throwing an exception in S3 table engine"}]}]} />

Ignore absence of file if it does not exist when reading certain keys.

Possible values:

* 1 — `SELECT` returns empty result.
* 0 — `SELECT` throws an exception.

<h2 id="s3_list_object_keys_size">
  s3\_list\_object\_keys\_size
</h2>

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

Maximum number of files that could be returned in batch by ListObject request

<h2 id="s3_min_upload_part_size">
  s3\_min\_upload\_part\_size
</h2>

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

The minimum size of part to upload during multipart upload to S3.

<h2 id="s3_path_filter_limit">
  s3\_path\_filter\_limit
</h2>

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

<VersionHistory rows={[{"id": "row-1","items": [{"label": "25.12"},{"label": "1000"},{"label": "New setting"}]}]} />

Maximum number of `_path` values that can be extracted from query filters to use for file iteration
instead of glob listing. 0 means disabled.

<h2 id="s3_request_timeout_ms">
  s3\_request\_timeout\_ms
</h2>

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

Idleness timeout for sending and receiving data to/from S3. Fail if a single TCP read or write call blocks for this long.

<h2 id="s3_skip_empty_files">
  s3\_skip\_empty\_files
</h2>

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

<VersionHistory rows={[{"id": "row-1","items": [{"label": "24.11"},{"label": "1"},{"label": "We hope it will provide better UX"}]}]} />

Enables or disables skipping empty files in [S3](/reference/engines/table-engines/integrations/s3) engine tables.

Possible values:

* 0 — `SELECT` throws an exception if empty file is not compatible with requested format.
* 1 — `SELECT` returns empty result for empty file.

<h2 id="s3_slow_all_threads_after_network_error">
  s3\_slow\_all\_threads\_after\_network\_error
</h2>

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

<VersionHistory rows={[{"id": "row-1","items": [{"label": "25.5"},{"label": "1"},{"label": "New setting"}]}]} />

When set to `true`, all threads executing S3 requests to the same backup endpoint are slowed down
after any single s3 request encounters a retryable network error, such as socket timeout.
When set to `false`, each thread handles S3 request backoff independently of the others.

<h2 id="s3_strict_upload_part_size">
  s3\_strict\_upload\_part\_size
</h2>

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

The exact size of part to upload during multipart upload to S3 (some implementations does not supports variable size parts).

<h2 id="s3_throw_on_zero_files_match">
  s3\_throw\_on\_zero\_files\_match
</h2>

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

Throw an error, when ListObjects request cannot match any files

<h2 id="s3_truncate_on_insert">
  s3\_truncate\_on\_insert
</h2>

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

Enables or disables truncate before inserts in s3 engine tables. If disabled, an exception will be thrown on insert attempts if an S3 object already exists.

Possible values:

* 0 — `INSERT` query creates a new file or fail if file exists and s3\_create\_new\_file\_on\_insert is not set.
* 1 — `INSERT` query replaces existing content of the file with the new data.

See more details [here](/integrations/connectors/data-ingestion/AWS/integrating-s3-with-clickhouse#inserting-data).

<h2 id="s3_uri_style">
  s3\_uri\_style
</h2>

<SettingsInfoBlock type="S3UriStyle" default_value="auto" />

<VersionHistory rows={[{"id": "row-1","items": [{"label": "26.4"},{"label": "auto"},{"label": "New setting."}]}]} />

Force the s3 endpoint style. Possible values: auto, virtual\_hosted, path.

<h2 id="s3_use_adaptive_timeouts">
  s3\_use\_adaptive\_timeouts
</h2>

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

When set to `true` than for all s3 requests first two attempts are made with low send and receive timeouts.
When set to `false` than all attempts are made with identical timeouts.
