Clarifying confusing explanations for limiting cpus resource in docker-compose file to prevent misunderstanding as "percent of total CPU available".

This commit is contained in:
arthur_x1 2018-09-25 10:55:18 +10:00
parent db6eef42ff
commit 7753a6cd5a
2 changed files with 5 additions and 4 deletions

View File

@ -687,8 +687,8 @@ Each of these is a single value, analogous to its [docker service
create](/engine/reference/commandline/service_create.md) counterpart.
In this general example, the `redis` service is constrained to use no more than
50M of memory and `0.50` (50%) of available processing time (CPU), and has
`20M` of memory and `0.25` CPU time reserved (as always available to it).
50M of memory and `0.50` (50% of a single core) of available processing time (CPU),
and has `20M` of memory and `0.25` CPU time reserved (as always available to it).
```none
version: '3'

View File

@ -96,8 +96,9 @@ This `docker-compose.yml` file tells Docker to do the following:
- Pull [the image we uploaded in step 2](part2.md) from the registry.
- Run 5 instances of that image as a service
called `web`, limiting each one to use, at most, 10% of the CPU (across all
cores), and 50MB of RAM.
called `web`, limiting each one to use, at most, 10% of a single core of
CPU time (this could also be e.g. "1.5" to mean 1 and half core for each),
and 50MB of RAM.
- Immediately restart containers if one fails.