Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

raw_exec graphs for cpu and memory are misleading #12455

Open
shantanugadgil opened this issue Apr 5, 2022 · 3 comments
Open

raw_exec graphs for cpu and memory are misleading #12455

shantanugadgil opened this issue Apr 5, 2022 · 3 comments

Comments

@shantanugadgil
Copy link
Contributor

Nomad version

Nomad v1.2.6 (a6c6b47)

Operating system and Environment details

Amazon Linux 2, Ubuntu 16.04/18.04/20.04

Issue

Misleading CPU and Memory usage graphs when using raw_exec tasks.

Reproduction steps

Configure a raw_exec task with a very low value of cpu and memory like so:

      resources {
        cpu    = 32
        memory = 32
      }

When the process starts using much more memory than 32 MB and much more CPU than 32 MHz, the graph in the Nomad Gui looks misleading.

Expected Result

Maybe the raw_exec graphs could be plotted using the fingerprinted values of the host?

Actual Result

Screenshot:
image

Job file (if appropriate)

N/A

Nomad Server logs (if appropriate)

N/A

Nomad Client logs (if appropriate)

N/A

@shantanugadgil shantanugadgil changed the title raw_exec gprahps for cpu and memory are misleading raw_exec graphs for cpu and memory are misleading Apr 5, 2022
@shoenig
Copy link
Member

shoenig commented Apr 5, 2022

Thanks for the report, @shantanugadgil ! Indeed this seems fairly trivial to reproduce

example jobfile
job "py" {
  datacenters = ["dc1"]
  type        = "service"

  group "py" {
    task "py" {
      driver = "raw_exec"
      user   = "nobody"
      config {
        command = "/usr/bin/python3"
        args    = ["-m", "http.server", "--directory", "/tmp"]
      }
      resources {
        memory = 12
        cpu    = 12
      }
    }
  }
}

Just run that and browse to the task in the UI.

@Lord-Y
Copy link

Lord-Y commented Apr 21, 2022

I'm having kind of the same problem with nomad 1.2.6 with docker image.

image

The memory usage is always having 0 bytes while docker stats tell totally the opposite:

CONTAINER ID   NAME                                          CPU %     MEM USAGE / LIMIT   MEM %     NET I/O          BLOCK I/O         PIDS
9474873dc105   server-6eb853a9-8ad0-be54-edca-1b4a091b1a16   13.58%    252.7MiB / 256MiB   98.69%    72.5MB / 203MB   35.4MB / 50.3MB   48

In our job spec we reserve 256MB with no limit.
OS:

Distributor ID: Debian
Description:    Debian GNU/Linux 11 (bullseye)
Release:        11
Codename:       bullseye

We have no particular error in agent log in debug.

@Lord-Y
Copy link

Lord-Y commented Apr 21, 2022

Okay so I can see that my memory graph issue is related to cgroup v2 and will be fixed in nomad 1.3.0. More informations are here #10251. I'll wait for nomad 1.3.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Needs Roadmapping
Development

No branches or pull requests

3 participants