---
title: OceanBase 租户 CPU 超卖配置实践-OceanBase数据库使用指南
description: 了解OceanBase数据库在实际应用中关于OceanBase 租户 CPU 超卖配置实践相关的常见问题和使用技巧，帮助您快速解决OceanBase 租户 CPU 超卖配置实践的难题。
image: https://mdn.alipayobjects.com/huamei_22khvb/afts/img/A*OSPzQ6GUQF4AAAAAQHAAAAgAeiGDAQ/original
---
切换语言

- 中文站 - 简体中文
- International - English
- 日本站 - 日本語

划线反馈

# OceanBase 租户 CPU 超卖配置实践

更新时间：2026-07-02 15:41

适用版本： V3.1.x、V3.2.x、V4.0.x、V4.1.x、V4.2.x、V4.3.x 内容类型：TechNote  

OceanBase CPU 超卖适用于同一集群中不同租户间负载峰值错峰的场景，从而提高整体资源使用率。如果租户间峰值同时出现，开启 CPU 超卖可能导致租户之间 CPU 资源的互相抢占，互相影响，引发租户请求等待、响应时间抖动。 **备注：OceanBase 数据库仅支持 CPU 超卖，不支持其他资源的超卖**。 **说明：本文档区别于 OceanBase 官方文档提供的租户 CPU 超卖方案，OCP 中租户规格无 `min_cpu`、`max_cpu` 超卖标识，适用于代理二次售卖 OceanBase 租户场景**。

## 详细说明【配置案例】

1. OceanBase 服务器 CPU 配置及集群 CPU 配额。

   ```shell
   lscpu
   Architecture:                       x86_64
   CPU op-mode(s):                     32-bit, 64-bit
   Byte Order:                         Little Endian
   Address sizes:                      48 bits physical, 48 bits virtual
   CPU(s):                             32         --OceanBase 服务器逻辑CPU 32核
   On-line CPU(s) list:                0-31
   登录集群 sys 租户
   MySQL [oceanbase]> select svr_Ip,cpu_capacity,cpu_capacity_max,cpu_assigned,cpu_assigned_max from __all_virtual_server;
   +------------+--------------+------------------+--------------+------------------+
   | svr_Ip     | cpu_capacity | cpu_capacity_max | cpu_assigned | cpu_assigned_max |
   +------------+--------------+------------------+--------------+------------------+
   |xx.xx.xx.xx |           32 |               32 |           29 |               29 |
   +------------+--------------+------------------+--------------+------------------+

   ```

   ![image01](https://obbusiness-private.oss-cn-shanghai.aliyuncs.com/doc/img/knowledge-base/database/tenant/20250929ob-tenant-cpu-overselling-configuration-practice01.png)
 2. 配置集群 CPU 超卖。

   ```shell
   登录集群sys租户
   MySQL [oceanbase]> show parameters like 'cpu_count'\G
   *************************** 1. row ***************************
         zone: zone1
     svr_type: observer
       svr_ip: xx.xx.xx.xx
     svr_port: 2882
         name: cpu_count
    data_type: NULL
        value: 0
         info: the number of CPU\'s in the system. If this parameter is set to zero, the number will be set according to sysconf; otherwise, this parameter is used. Range: [0,+¡Þ) in integer
      section: OBSERVER
        scope: CLUSTER
       source: DEFAULT
   edit_level: DYNAMIC_EFFECTIVE
   default_value: 0
    isdefault: 1
   MySQL [oceanbase]> alter system set cpu_count=48;
   Query OK, 0 rows affected (0.092 sec)
   在线生效
   MySQL [oceanbase]> show parameters like 'cpu_count'\G
   *************************** 1. row ***************************
         zone: zone1
     svr_type: observer
       svr_ip: xx.xx.xx.xx
     svr_port: 2882
         name: cpu_count
    data_type: NULL
        value: 48
         info: the number of CPU\'s in the system. If this parameter is set to zero, the number will be set according to sysconf; otherwise, this parameter is used. Range: [0,+¡Þ) in integer
      section: OBSERVER
        scope: CLUSTER
       source: DEFAULT
   edit_level: DYNAMIC_EFFECTIVE
   default_value: 0
    isdefault: 0
   1 row in set (0.060 sec)
   MySQL [oceanbase]> select svr_Ip,cpu_capacity,cpu_capacity_max,cpu_assigned,cpu_assigned_max from __all_virtual_server;
   +------------+--------------+------------------+--------------+------------------+
   | svr_Ip     | cpu_capacity | cpu_capacity_max | cpu_assigned | cpu_assigned_max |
   +------------+--------------+------------------+--------------+------------------+
   |xx.xx.xx.xx |           48 |               48 |           29 |               29 |
   +------------+--------------+------------------+--------------+------------------+

   ```

   ![image02](https://obbusiness-private.oss-cn-shanghai.aliyuncs.com/doc/img/knowledge-base/database/tenant/20250929ob-tenant-cpu-overselling-configuration-practice02.png)
 3. 租户 CPU 扩容，验证超卖。

   ![image03](https://obbusiness-private.oss-cn-shanghai.aliyuncs.com/doc/img/knowledge-base/database/tenant/20250929ob-tenant-cpu-overselling-configuration-practice03.png)

   ```shell
   OCP 租户 CPU 规格由 10c 调大至 20c
   MySQL [oceanbase]> select svr_Ip,cpu_capacity,cpu_capacity_max,cpu_assigned,cpu_assigned_max from __all_virtual_server;
   +------------+--------------+------------------+--------------+------------------+
   | svr_Ip     | cpu_capacity | cpu_capacity_max | cpu_assigned | cpu_assigned_max |
   +------------+--------------+------------------+--------------+------------------+
   |xx.xx.xx.xx |           48 |               48 |           39 |               39 |
   +------------+--------------+------------------+--------------+------------------+
   MySQL [oceanbase]> select zone,MIN_CPU,MAX_CPU from gv$ob_units where tenant_id=1004;
   +-------+---------+---------+
   | zone  | MIN_CPU | MAX_CPU |
   +-------+---------+---------+
   | zone1 |      20 |      20 |
   +-------+---------+---------+

   ```

   ![image04](https://obbusiness-private.oss-cn-shanghai.aliyuncs.com/doc/img/knowledge-base/database/tenant/20250929ob-tenant-cpu-overselling-configuration-practice04.png)

   ![image05](https://obbusiness-private.oss-cn-shanghai.aliyuncs.com/doc/img/knowledge-base/database/tenant/20250929ob-tenant-cpu-overselling-configuration-practice05.png)

## 适用版本

OceanBase 数据库 V3.x、V4.x 版本。

Previous

[Oracle 租户环境中用户删除操作受阻解决方案](https://www.oceanbase.com/knowledge-base/oceanbase-database-1000000003238762)

Next

[缩小租户规格时遇到报错 requested memory over 90% 的原因和解决方法](https://www.oceanbase.com/knowledge-base/oceanbase-database-1000000003796389) ![有帮助](https://gw.alipayobjects.com/mdn/ob_asset/afts/img/A*y6ocSqN8cqsAAAAAAAAAAAAAARQnAQ)![无帮助](https://gw.alipayobjects.com/mdn/ob_asset/afts/img/A*BG9IQJyLHF8AAAAAAAAAAAAAARQnAQ)![反馈](https://gw.alipayobjects.com/mdn/ob_asset/afts/img/A*eTWdQKCRKHwAAAAAAAAAAAAAARQnAQ)[AI](https://www.oceanbase.com/obi) 咨询热线
