Moby: Any body know what is NanoCPUS in inspect node response and how is that value calculated? Thanks

Created on 16 Jul 2016  路  3Comments  路  Source: moby/moby

aredocs areswarm kinquestion

Most helpful comment

@cmingxu Based on the calculation:
https://github.com/docker/docker/blob/v1.12.0-rc4/daemon/cluster/executor/container/container.go#L328-L332

resources.CPUQuota = r.Limits.NanoCPUs * resources.CPUPeriod / 1e9

, NanoCPUs is defined as the CPU shares in units of 1/1e9 (or 10^-9) of the CPU.

In other words, NanoCPUs is the number of nano (1/1e9) CPUs by a process.

All 3 comments

/cc @aluzzardi @sfsmithcha

@cmingxu Based on the calculation:
https://github.com/docker/docker/blob/v1.12.0-rc4/daemon/cluster/executor/container/container.go#L328-L332

resources.CPUQuota = r.Limits.NanoCPUs * resources.CPUPeriod / 1e9

, NanoCPUs is defined as the CPU shares in units of 1/1e9 (or 10^-9) of the CPU.

In other words, NanoCPUs is the number of nano (1/1e9) CPUs by a process.

This issue should be closed. This should be documented in https://docs.docker.com/engine/reference/commandline/service_create/#options (thus this issue is superseded by #30222)

Was this page helpful?
0 / 5 - 0 ratings