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

# query_profiler_* 会话设置

> ClickHouse 在 query_profiler_* 生成分组中的会话设置。

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/zh/reference/system-tables/settings) 中查看，并由 [源代码](https://github.com/ClickHouse/ClickHouse/blob/master/src/Core/Settings.cpp) 自动生成。

<div id="query_profiler_cpu_time_period_ns">
  ## query\_profiler\_cpu\_time\_period\_ns
</div>

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

设置 [query profiler](/docs/zh/concepts/features/performance/troubleshoot/sampling-query-profiler) 的 CPU 时钟定时器周期。该定时器仅统计 CPU 时间。

可能的值：

* 以纳秒为单位的正整数。

  推荐值：

  * 对于单个查询，建议使用 10000000 (每秒 100 次) 纳秒或更大的值。
  * 对于集群级性能分析，建议使用 1000000000 (每秒一次) 。

* 0 表示关闭该定时器。

另请参阅：

* 系统表 [trace\_log](/docs/zh/reference/system-tables/trace_log)

<div id="query_profiler_real_time_period_ns">
  ## query\_profiler\_real\_time\_period\_ns
</div>

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

设置 [query profiler](/docs/zh/concepts/features/performance/troubleshoot/sampling-query-profiler) 的实时时钟定时器周期。实时时钟定时器按挂钟时间计时。

可能的值：

* 以纳秒为单位的正整数。

  推荐值：

  * 对于单个查询，10000000 (每秒 100 次) 纳秒及以下。
  * 对于集群级性能分析，1000000000 (每秒一次) 。

* 0 表示关闭定时器。

另请参见：

* 系统表 [trace\_log](/docs/zh/reference/system-tables/trace_log)

Cloud 默认值：`3000000000`。
