A
A
Alexander Nazarov2022-04-09 22:16:17
Docker
Alexander Nazarov, 2022-04-09 22:16:17

How to return the default value of the NanoCpus parameter?

The default value of the NanoCpus parameter is 0

docker inspect --format='{{.HostConfig.NanoCpus}}' conainer


If we update the container:
docker update --cpus "1" conainer

We get: 1000000000

How to restore the value back to zero?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Karabanov, 2022-04-10
@karabanov

--cpus=<value>
Specify how much of the available CPU resources a container can use. For instance, if the host machine has two CPUs and you set --cpus="1.5", the container is guaranteed at most one and a half of the CPUs. This is the equivalent of setting --cpu-period="100000" and --cpu-quota="150000".

To return the behavior to the default, you must set it --cpusequal to the number of processors in the system.
To .HostConfig.NanoCpusbecome equal to 0, you can recreate the container.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question