> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-postgresql-tls-support.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# page_cache_* 服务器设置

> 属于 page_cache_* 生成组的 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>;
};

这些设置用于配置 ClickHouse 服务器，并由 ClickHouse 源代码自动生成。

<div id="page_cache_free_memory_ratio">
  ## page\_cache\_free\_memory\_ratio
</div>

<SettingsInfoBlock type="Double" default_value="0.15" changeable_without_restart="No" />将内存限制中的一部分保留为不供用户态页缓存使用。类似于 Linux 的 min\_free\_kbytes 设置。

<div id="page_cache_history_window_ms">
  ## page\_cache\_history\_window\_ms
</div>

<SettingsInfoBlock type="UInt64" default_value="1000" changeable_without_restart="No" />已释放的内存在可供用户态页缓存使用前的延迟时间。

<div id="page_cache_max_size">
  ## page\_cache\_max\_size
</div>

<SettingsInfoBlock type="UInt64" default_value="0" changeable_without_restart="No" />用户态页缓存的最大容量。将其设为 0 可禁用缓存。如果该值大于 page\_cache\_min\_size，缓存大小将在此范围内持续调整，以便在使总内存使用量保持低于限制值 (max\_server\_memory\_usage\[\_to\_ram\_ratio]) 的同时，尽可能利用大部分可用内存。

<div id="page_cache_min_size">
  ## page\_cache\_min\_size
</div>

<SettingsInfoBlock type="UInt64" default_value="104857600" changeable_without_restart="No" />用户态页缓存的最小容量。

<div id="page_cache_policy">
  ## page\_cache\_policy
</div>

<SettingsInfoBlock type="String" default_value="SLRU" changeable_without_restart="No" />用户态页缓存策略名称。

<div id="page_cache_shards">
  ## page\_cache\_shards
</div>

<SettingsInfoBlock type="UInt64" default_value="4" changeable_without_restart="No" />将用户态页缓存拆分为这么多个分片，以减少互斥锁争用。Experimental，预计不太会提升性能。

<div id="page_cache_size_ratio">
  ## page\_cache\_size\_ratio
</div>

<SettingsInfoBlock type="Double" default_value="0.5" changeable_without_restart="No" />用户态页缓存中受保护队列的大小与缓存总大小的比值。
