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

> 在 ClickHouse Cloud 中配置垂直自动扩缩容

# 垂直自动扩缩容

export const ScalePlanFeatureBadge = ({feature = 'This feature', linking_verb_are = false}) => {
  return <div className="scalePlanFeatureContainer">
            <div className="scalePlanFeatureBadge">
                Scale plan feature
            </div>
            <div>
                <p>{feature} {linking_verb_are ? 'are' : 'is'} available in the Scale and Enterprise plans. To upgrade, visit the plans page in the cloud console.</p>
            </div>
        </div>;
};

export const Image = ({img, alt, size}) => {
  return <Frame>
      <img src={img} alt={alt} />
    </Frame>;
};

Scale 和 Enterprise 层级服务支持基于 CPU 和内存使用情况的自动扩缩容。系统会在回溯窗口内持续监测服务使用情况，以做出扩缩容决策。如果使用量高于或低于特定阈值，服务就会相应扩缩容，以匹配实际需求。

<div id="configuring-vertical-auto-scaling">
  ## 配置垂直自动扩缩容
</div>

拥有 **Admin** 角色的组织成员可以调整 ClickHouse Cloud Scale 或 Enterprise 服务的垂直扩缩容。要配置垂直自动扩缩容，请前往服务的 **设置** 选项卡，并按下图所示调整最小和最大内存以及 CPU 设置。

<Note>
  并非所有层级的单副本服务都支持扩缩容。
</Note>

<Image img="https://mintcdn.com/private-7c7dfe99-mintlify-1d264819/m-pFevVPEi7O6tdD/images/cloud/manage/AutoScaling.png?fit=max&auto=format&n=m-pFevVPEi7O6tdD&q=85&s=05a3f9ef1a7b1275de42add9d7b062ff" size="lg" alt="扩缩容设置页面" border width="3840" height="2144" data-path="images/cloud/manage/AutoScaling.png" />

请将副本的 **最大内存** 设置为高于 **最小内存** 的值。之后，服务会根据需要在该范围内自动扩缩容。初始创建服务时也可以配置这些设置。服务中的每个副本都会分配相同的内存和 CPU 资源。

你也可以将这两个值设为相同，这实际上相当于将服务“锁定”到某个特定配置。这样做会立即强制服务扩缩容到你所选的目标规格。

需要注意的是，这会禁用集群上的自动扩缩容；当 CPU 或内存使用量增长超出这些设置时，服务将无法获得相应保护。

<Note>
  对于 Enterprise 层级服务，标准 1:4 profile 支持垂直自动扩缩容。自定义 profile 不支持垂直自动扩缩容或手动垂直扩缩容。不过，这些服务仍可通过联系支持团队进行垂直扩缩容。
</Note>
