Server Settings

You can configure multiple `<graphite>` clauses. For instance, you can use this for sending different data at different intervals.

**Example**

```
<graphite>
    <host>localhost</host>
    <port>42000</port>
    <timeout>0.1</timeout>
    <interval>60</interval>
    <root_path>one_min</root_path>
    <metrics>true</metrics>
    <events>true</events>
    <events_cumulative>false</events_cumulative>
    <asynchronous_metrics>true</asynchronous_metrics>
</graphite>
```

## graphite\_rollup[​](#graphite_rollup "Direct link to graphite_rollup")

Settings for thinning data for Graphite.

For more details, see [GraphiteMergeTree](/docs/engines/table-engines/mergetree-family/graphitemergetree).

**Example**

```
<graphite_rollup_example>
    <default>
        <function>max</function>
        <retention>
            <age>0</age>
            <precision>60</precision>
        </retention>
        <retention>
            <age>3600</age>
            <precision>300</precision>
        </retention>
        <retention>
            <age>86400</age>
            <precision>3600</precision>
        </retention>
    </default>
</graphite_rollup_example>
```

## hdfs.libhdfs3\_conf[​](#hdfs.libhdfs3_conf "Direct link to hdfs.libhdfs3_conf")

Points libhdfs3 to the right location for its config.

## hsts\_max\_age[​](#hsts_max_age "Direct link to hsts_max_age")

Expired time for HSTS in seconds.

Note

A value of `0` means ClickHouse disables HSTS. If you set a positive number, the HSTS will be enabled and the max-age is the number you set.

**Example**

```
<hsts_max_age>600000</hsts_max_age>
```

## http\_connections\_hard\_limit[​](#http_connections_hard_limit "Direct link to http_connections_hard_limit")

Exception is thrown at a creation attempt when this limit is reached. Set to 0 to turn off hard limitation. The limit applies to the http connections which do not belong to any disk or storage.

## http\_connections\_soft\_limit[​](#http_connections_soft_limit "Direct link to http_connections_soft_limit")

Connections above this limit have significantly shorter time to live. The limit applies to the http connections which do not belong to any disk or storage.

## http\_connections\_store\_limit[​](#http_connections_store_limit "Direct link to http_connections_store_limit")

Connections above this limit reset after use. Set to 0 to turn connection cache off. The limit applies to the http connections which do not belong to any disk or storage.

## http\_connections\_warn\_limit[​](#http_connections_warn_limit "Direct link to http_connections_warn_limit")

Warning massages are written to the logs if number of in-use connections are higher than this limit. The limit applies to the http connections which do not belong to any disk or storage.

## http\_handlers[​](#http_handlers "Direct link to http_handlers")

Allows using custom HTTP handlers.
To add a new http handler simply add a new `<rule>`.
Rules are checked from top to bottom as defined,
and the first match will run the handler.

The following settings can be configured by sub-tags:

|  |  |  |  |  |  |  |  |  |  |  |  |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| Sub-tags Definition|  |  |  |  |  |  |  |  |  |  | | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | | `url` To match the request URL, you can use the 'regex:' prefix to use regex match (optional)|  |  |  |  |  |  |  |  | | --- | --- | --- | --- | --- | --- | --- | --- | | `methods` To match request methods, you can use commas to separate multiple method matches (optional)|  |  |  |  |  |  | | --- | --- | --- | --- | --- | --- | | `headers` To match request headers, match each child element (child element name is header name), you can use 'regex:' prefix to use regex match (optional)|  |  |  |  | | --- | --- | --- | --- | | `handler` The request handler|  |  | | --- | --- | | `empty_query_string` Check that there is no query string in the URL | | | | | | | | | | | |

`handler` contains the following settings, which can be configured by sub-tags:

|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| Sub-tags Definition|  |  |  |  |  |  |  |  |  |  |  |  |  |  | | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | | `url` A location for redirect|  |  |  |  |  |  |  |  |  |  |  |  | | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | | `type` Supported types: static, dynamic\_query\_handler, predefined\_query\_handler, redirect|  |  |  |  |  |  |  |  |  |  | | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | | `status` Use with static type, response status code|  |  |  |  |  |  |  |  | | --- | --- | --- | --- | --- | --- | --- | --- | | `query_param_name` Use with dynamic\_query\_handler type, extracts and executes the value corresponding to the `<query_param_name>` value in HTTP request params| `query` Use with predefined\_query\_handler type, executes query when the handler is called|  |  |  |  | | --- | --- | --- | --- | | `content_type` Use with static type, response content-type|  |  | | --- | --- | | `response_content` Use with static type, Response content sent to client, when using the prefix 'file://' or 'config://', find the content from the file or configuration send to client | | | | | | | | | | | | | | | |

Along with a list of rules, you can specify `<defaults/>` which specifies to enable all the default handlers.

Example:

```
<http_handlers>
    <rule>
        <url>/</url>
        <methods>POST,GET</methods>
        <headers><pragma>no-cache</pragma></headers>
        <handler>
            <type>dynamic_query_handler</type>
            <query_param_name>query</query_param_name>
        </handler>
    </rule>

    <rule>
        <url>/predefined_query</url>
        <methods>POST,GET</methods>
        <handler>
            <type>predefined_query_handler</type>
            <query>SELECT * FROM system.settings</query>
        </handler>
    </rule>

    <rule>
        <handler>
            <type>static</type>
            <status>200</status>
            <content_type>text/plain; charset=UTF-8</content_type>
            <response_content>config://http_server_default_response</response_content>
        </handler>
    </rule>
</http_handlers>
```

## http\_options\_response[​](#http_options_response "Direct link to http_options_response")

Used to add headers to the response in an `OPTIONS` HTTP request.
The `OPTIONS` method is used when making CORS preflight requests.

For more information, see [OPTIONS](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/OPTIONS).

Example:

```
<http_options_response>
     <header>
            <name>Access-Control-Allow-Origin</name>
            <value>*</value>
     </header>
     <header>
          <name>Access-Control-Allow-Headers</name>
          <value>origin, x-requested-with, x-clickhouse-format, x-clickhouse-user, x-clickhouse-key, Authorization</value>
     </header>
     <header>
          <name>Access-Control-Allow-Methods</name>
          <value>POST, GET, OPTIONS</value>
     </header>
     <header>
          <name>Access-Control-Max-Age</name>
          <value>86400</value>
     </header>
</http_options_response>
```

## http\_server\_default\_response[​](#http_server_default_response "Direct link to http_server_default_response")

The page that is shown by default when you access the ClickHouse HTTP(s) server.
The default value is "Ok." (with a line feed at the end)

**Example**

Opens `https://tabix.io/` when accessing `http://localhost: http_port`.

```
<http_server_default_response>
  <![CDATA[<html ng-app="SMI2"><head><base href="http://ui.tabix.io/"></head><body><div ui-view="" class="content-ui"></div><script src="http://loader.tabix.io/master.js"></script></body></html>]]>
</http_server_default_response>
```

## iceberg\_background\_schedule\_pool\_size[​](#iceberg_background_schedule_pool_size "Direct link to iceberg_background_schedule_pool_size")