windows_exporter icon indicating copy to clipboard operation
windows_exporter copied to clipboard

windows_cs_logical_processors show only physical cores

Open AvdeevArtem opened this issue 3 years ago • 8 comments

Hello. Windows_cs_logical_processors return only physical cores but should return logical cores. I have servers with 96 logical cores and windows_cs_logical_processors return me value 48.

# HELP windows_cs_logical_processors ComputerSystem.NumberOfLogicalProcessors
# TYPE windows_cs_logical_processors gauge
windows_cs_logical_processors 48

windows_hyperv_hypervisor_logical_processors work fine and return right value 96

OS: Windows server 2016, 2022 Windows 10 Exporter version: 0.17.1, 0.18.01

AvdeevArtem avatar Feb 18 '22 08:02 AvdeevArtem

Can you please give me the following values in the "Performance > CPU" tab of the Task Manager of the Hyper-V Host please?

  • Sockets
  • Cores
  • Logical processors
  • Host logical processors (If availeable)

Should look something like this: image

JDA88 avatar Feb 21 '22 12:02 JDA88

@JDA88 you got a NASA computer? wtf 64 cores anyways https://i.imgur.com/uzFnPLO.png i want to get the 8 not 16 how could i do that

Oscaramr avatar Feb 24 '22 19:02 Oscaramr

I think your need is different from @AvdeevArtem issue, no?

The current version of the Exporter only expose Logical Processors. It doesn't expose the number of Sockets, the number of core per Processors and the fact that Hyper-Threading is enabled or not

I think of two way to fix this in the exporter:

  • Create a few new metrics: windows_cs_sockets_count 2 windows_cs_cores_per_socket_count 8 windows_cs_logical_processors_count 16 (renamed from windows_cs_logical_processors as the _count suffix make sense) The Hyper-Threading can be deducted by query if (windows_cs_sockets_count * windows_cs_cores_per_socket_count != windows_cs_logical_processors_count) then Hyper-Threading is enabled

  • Change the current label core in the existing metric {core="0,0"} to {socket="0",core="0"} Count by socket would give you the physical processors count Count by core would give you the physical processors core count Then the same query as above to get the Hyper-Threading status

JDA88 avatar Feb 24 '22 19:02 JDA88

@JDA88 Hello. 2x Intel® Xeon® Gold 6342 Screenshot_15

AvdeevArtem avatar Feb 24 '22 21:02 AvdeevArtem

Thanks, @AvdeevArtem

Ok, so your system have:

  • 2 Physical CPU
  • 48 Core each
  • Hyper-Threading is enabled

What does the following PowerShell command return? Get-WmiObject -class Win32_processor | ft NumberOfCores,NumberOfLogicalProcessors

Bonus question: How many lines of windows_cpu_processor_performance metric do you have? 48 or 96?

I might have an idea of what's appending but unfortunately I do not currently have a dual (or more) socket Windows with Hyper-Threading enable on hand to reproduce.

Maybe there is a bug in windows_cs_logical_processors logic that return a wrong value on multi socket computers. Can someone else make the test on another computer?

JDA88 avatar Feb 24 '22 22:02 JDA88

In my case, a Windows Server 2019 with dual Intel(R) Xeon(R) Gold 5218R CPU @ 2.10GHz:

Task Manager: image

PS C:\> Get-WmiObject -class Win32_processor | ft NumberOfCores,NumberOfLogicalProcessors

NumberOfCores NumberOfLogicalProcessors
------------- -------------------------
           20                        40
           20                        40

The output of the url /integrations/windows_exporter/metrics:

# HELP windows_cs_logical_processors ComputerSystem.NumberOfLogicalProcessors
# TYPE windows_cs_logical_processors gauge
windows_cs_logical_processors 80

I'm not exactly using windows_exporter directly but through grafana-agent. I hope it helps anyway:

C:\Program Files\Grafana Agent>agent-windows-amd64.exe -version
agent, version v0.23.0 (branch: HEAD, revision: 36b8ca75)
  build user:       root@360da2ffbf37
  build date:       2022-02-10T15:31:14Z
  go version:       go1.17.6
  platform:         windows/amd64

jagbarcelo avatar Feb 25 '22 16:02 jagbarcelo

@jagbarcelo Thanks for the feedback, on your side everything is working fine. I'm out of ideas :(

JDA88 avatar Feb 25 '22 16:02 JDA88

PS C:\Windows\system32> Get-WmiObject -class Win32_processor | ft NumberOfCores,NumberOfLogicalProcessors

NumberOfCores NumberOfLogicalProcessors
------------- -------------------------
           24                        48
           24                        48

windows_cpu_processor_performance show me 96 lines

This is strange because on 60 servers with relatively new CPUs(all dual) the metric shows the wrong values, but on servers, with older CPUs like the Dual Xeon e-2690 v4 the metric shows the correct values

AvdeevArtem avatar Mar 01 '22 21:03 AvdeevArtem

This issue has been marked as stale because it has been open for 90 days with no activity. This thread will be automatically closed in 30 days if no further activity occurs.

github-actions[bot] avatar Nov 25 '23 02:11 github-actions[bot]

This is still the issue on version 0.24.0

3rmack avatar Mar 01 '24 08:03 3rmack