Questions about Displaying Host Information and CPU Information in TiDB Dashboard

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: TiDB Dashboard中主机信息CPU信息展示疑问

| username: seiang

[TiDB Usage Environment] Production Environment / Testing / Poc
[TiDB Version] v6.5.1
[Reproduction Path] What operations were performed when the issue occurred
[Encountered Issue: Issue Phenomenon and Impact]
[Resource Configuration] Enter TiDB Dashboard - Cluster Info - Hosts and take a screenshot of this page
[Attachments: Screenshots/Logs/Monitoring]

In the TiDB Dashboard, the CPU information under Host Information shows both logical CPUs and physical CPUs.
Question 1: Is the information displayed here retrieved from the cluster_hardware table?
Question 2: The physical CPU is 16, but why is the logical CPU 8? How is the logical CPU information obtained from the OS level?

Shouldn’t the logical CPU count be 16 when checking the OS?

cat /proc/cpuinfo | grep “processor” | wc -l

image

| username: WalterWj | Original post link

This refers to the number of physical cores and the number of cores after hyper-threading is enabled, right?

| username: seiang | Original post link

The Logical Cores displayed here don’t seem quite right. How exactly is this data being obtained?

| username: MrSylar | Original post link

Did you bind the NUMA node?

| username: seiang | Original post link

NUMA is not bound, and the node host is a virtual machine.

| username: WalterWj | Original post link

Compare the server lscpu, compare both 16 and 8 & 16.

| username: h5n1 | Original post link

It seems to be reversed.

| username: seiang | Original post link

Here is the result of lscpu,

| username: WalterWj | Original post link

Oops, it seems to be reversed. Haha.

| username: seiang | Original post link

It doesn’t seem to be a rollback. This is the lscpu result of another node host, which is exactly the same as the one above. However, in the TiDB Dashboard, it shows as 16(16).

| username: 像风一样的男子 | Original post link

Is it displayed in reverse?
image

| username: seiang | Original post link

I’m not quite sure, so I need help from you experts to confirm where exactly the problem is.

| username: 春风十里 | Original post link

Physical CPU refers to the number of physical CPUs installed on the machine, which can be easily observed after disassembly. In the operating system, this corresponds to the physical id. The number of physical cores refers to the number of cores in this physical CPU (which also physically exist). Logical CPU means that a physical core has multi-threading technology, understood as logical CPU, which is the processor.

For example, checking the physical machine out-of-band:

Checking through the operating system, there are 2 physical CPUs, each with 10 cores, totaling 40 logical CPUs.

| username: seiang | Original post link

Then the normal logic should be 16 CPUs as well. The result is as follows:

| username: 春风十里 | Original post link

Yes, the logical CPUs should be 16. Is this a physical machine acting as the host? However, I have never seen a machine with 16 physical CPUs; the most I have seen here is 4 physical CPUs.

| username: seiang | Original post link

Yes, it’s not a physical machine, it’s a virtual machine. The CPU information you see is at the virtual host level.

| username: dba远航 | Original post link

It feels like there is an issue with the information being retrieved.

| username: oceanzhang | Original post link

You might have misunderstood the information.

| username: 春风十里 | Original post link

Have you adjusted the number of CPUs for the virtual machine? Since this is a virtual machine, the number of CPUs allocated is logical CPUs, and this number can be set arbitrarily. For example, my desktop machine has 1 physical CPU with 6 cores and 6 logical CPUs. I allocated 9 CPUs to the virtual machine, and what you see in the virtual machine’s operating system are 9 logical CPUs. The situation for the original poster should be similar. With many physical CPUs (16), the number of CPUs allocated to the virtual machine should be 16, making the number of logical CPUs 16.

| username: seiang | Original post link

Adjusted the CPU, previously it was 8 cores, now it is 16 cores.