> ## 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.

# user_* server settings

> ClickHouse server settings in the user_* generated group.

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 configure the ClickHouse server and are autogenerated from ClickHouse source.

<h2 id="user_directories">
  user\_directories
</h2>

Section of the configuration file that contains settings:

* Path to configuration file with predefined users.
* Path to folder where users created by SQL commands are stored.
* ZooKeeper node path where users created by SQL commands are stored and replicated.

If this section is specified, the path from [users\_config](/docs/reference/settings/server-settings/settings/users#users_config) and [access\_control\_path](/docs/reference/settings/server-settings/settings/access-control#access_control_path) won't be used.

The `user_directories` section can contain any number of items, the order of the items means their precedence (the higher the item the higher the precedence).

**Examples**

```xml theme={null}
<user_directories>
    <users_xml>
        <path>/etc/clickhouse-server/users.xml</path>
    </users_xml>
    <local_directory>
        <path>/var/lib/clickhouse/access/</path>
    </local_directory>
</user_directories>
```

Users, roles, row policies, quotas, and profiles can be also stored in ZooKeeper:

```xml theme={null}
<user_directories>
    <users_xml>
        <path>/etc/clickhouse-server/users.xml</path>
    </users_xml>
    <replicated>
        <zookeeper_path>/clickhouse/access/</zookeeper_path>
    </replicated>
</user_directories>
```

You can also define sections `memory` — means storing information only in memory, without writing to disk, and `ldap` — means storing information on an LDAP server.

To add an LDAP server as a remote user directory of users that are not defined locally, define a single `ldap` section with the following settings:

| Setting | Description |
| - | - |
| `roles` | section with a list of locally defined roles that will be assigned to each user retrieved from the LDAP server. If no roles are specified, user will not be able to perform any actions after authentication. If any of the listed roles is not defined locally at the time of authentication, the authentication attempt will fail as if the provided password was incorrect. |
| `server` | one of LDAP server names defined in `ldap_servers` config section. This parameter is mandatory and cannot be empty. |

**Example**

```xml theme={null}
<ldap>
    <server>my_ldap_server</server>
        <roles>
            <my_local_role1 />
            <my_local_role2 />
        </roles>
</ldap>
```

<h2 id="user_files_path">
  user\_files\_path
</h2>

<SettingsInfoBlock type="String" default_value="/var/lib/clickhouse/user_files/" changeable_without_restart="No" />

The directory with user files. Used in the table function [file()](/docs/reference/functions/table-functions/file), [fileCluster()](/docs/reference/functions/table-functions/fileCluster).

**Example**

```xml theme={null}
<user_files_path>/var/lib/clickhouse/user_files/</user_files_path>
```

<h2 id="user_profile_events_per_cpu">
  user\_profile\_events\_per\_cpu
</h2>

<SettingsInfoBlock type="Bool" default_value="1" changeable_without_restart="No" />Shard per-user `ProfileEvents` counters per CPU to avoid cross-CPU cache-line contention under high thread counts. Each user pays `getNumCPUs() * num_events * sizeof(atomic)` of memory (hundreds of KiB on machines with many cores). Disable to fall back to a single shared atomic per event per user, trading throughput for memory.

<h2 id="user_scripts_path">
  user\_scripts\_path
</h2>

<SettingsInfoBlock type="String" default_value="/var/lib/clickhouse/user_scripts/" changeable_without_restart="No" />

The directory with user scripts files. Used for Executable user defined functions [Executable User Defined Functions](/docs/reference/functions/regular-functions/udf#executable-user-defined-functions).

**Example**

```xml theme={null}
<user_scripts_path>/var/lib/clickhouse/user_scripts/</user_scripts_path>
```
