请问__all_virtual_server_stat中的cpu_total值和机器不匹配

【产品名称】ob

【产品版本】3.1.2

【问题描述】

MySQL [oceanbase]> SELECT svr_ip,svr_port, cpu_total, mem_total, disk_total, zone FROM __all_virtual_server_stat ;

±----------------±---------±----------±-----------±------------±------+

| svr_ip | svr_port | cpu_total | mem_total | disk_total | zone |

±----------------±---------±----------±-----------±------------±------+

| 192.168.137.129 | 2882 | 14 | 4294967296 | 15032385536 | zone1 |

±----------------±---------±----------±-----------±------------±------+

1 row in set (0.173 sec)

[root@localhost ~]# lscpu

Architecture: x86_64

CPU op-mode(s): 32-bit, 64-bit

Byte Order: Little Endian

CPU(s): 4

On-line CPU(s) list: 0-3

Thread(s) per core: 1

Core(s) per socket: 2

Socket(s): 2

#问题

实际上虚拟机只有4core,为啥上面的SQL中查出来是14core

需要查看一下,如果cpu_count=0,才会去自动检测cpu的数量,负责就直接使用这个值,__all_virtual_server_stat虚拟表里查的结果还要减掉系统保留的cpu数(cpu_reserved参数控制,默认是2)。

show parameters like 'cpu_count';

show parameters like 'cpu_reserved';


cpu_count=16

cpu_reserved=2


所以在虚拟表里__all_virtual_server_stat对应的cpu_total就是14。

嗯,其实也就是默认cpu_count为16呗。

默认值是0,https://open.oceanbase.com/docs/community/oceanbase-database/V3.1.2/cpu_count

如果是obd方式部署的,需要看一下yaml文件里有没有想过的配置项。

好的,多谢。