基于湖库一体架构,统一管理结构化、半结构化与非结构化等多模态数据,一个系统承载事务处理、实时分析与 AI 工作负载。
OceanBase 租户 CPU 超卖配置实践
更新时间:2026-07-02 15:41
OceanBase CPU 超卖适用于同一集群中不同租户间负载峰值错峰的场景,从而提高整体资源使用率。如果租户间峰值同时出现,开启 CPU 超卖可能导致租户之间 CPU 资源的互相抢占,互相影响,引发租户请求等待、响应时间抖动。 备注:OceanBase 数据库仅支持 CPU 超卖,不支持其他资源的超卖。 说明:本文档区别于 OceanBase 官方文档提供的租户 CPU 超卖方案,OCP 中租户规格无 min_cpu、max_cpu 超卖标识,适用于代理二次售卖 OceanBase 租户场景。
详细说明【配置案例】
OceanBase 服务器 CPU 配置及集群 CPU 配额。
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 | +------------+--------------+------------------+--------------+------------------+
配置集群 CPU 超卖。
登录集群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 | +------------+--------------+------------------+--------------+------------------+
租户 CPU 扩容,验证超卖。

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 | +-------+---------+---------+

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