Skip to content

Incorrect cores shown for coder stat cpu --host #15635

Open
@gjrtimmer

Description

@gjrtimmer

I do not know how to fix this in the code, but I've done some research to describe my issue.

Coder Information

Version: 2.16.1
Environment: Nomad Cluster
Hardware: Turing PI Cluster Board
Hardware Modules:

  • 3 RK1 Modules
  • 1 Nvidia Orin NX

Issue

The reported amount of cores needs to be corrected.
The hardware has eight cores total, and for the workspace, one core is allocated to the workspace.
This issue is that for the metadata coder stat cpu it reports the correct amount of cores, however for the --host cores I was expecting it to report /8 cores, instead of 1.

Analysis

So, I reached this, and to my knowledge, Golang NumProc returns the number of logical CPUs. I think that for the workspace, this is fine, as seen in the screenshot for the left meta key. However, for the host, I think the value of the cli tool nproc --all should be used, or the cgroup or /proc or whatever returns the actual number of cores of the CPU if the proc command is not available.

I hope my analysis is sufficient to have somebody look at this and fix it.

Screenshot:

Image

P.S.
If you are wondering why the `filebrowser' shows the correct icon, I also posted an issue about it 349. I wrote my own terraform module, which uses the raw GitHub link of the file browser repo to show the correct icon.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug riskProne to bugsneeds-triageIssue that require triages3Bugs that confuse, annoy, or are purely cosmetic

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions