compose: docker-compose does not support cpus parameter
docker-compose does not support cpus parameter:
ERROR: The Compose file '.\.\docker-compose.test.yml' is invalid because: Unsupported config option for services.test: 'cpus'
Please add support for --cpus parameter.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 1
- Comments: 15
Why option cpu-count called so? It’s the incorrect name, because for cpu_count: 1 I expect that only 1 CPU will be active. However, I see only the loading on the baseline performance. Also, very very bad documentation and there aren’t any explanations about cpu* options for “windows only”. I don’t understand why you removed these options from the compose 3.* versions. My problem is I need to restrict my windows containers for CPUs utilization, but I don’t see clarify solutions for it which similar to the behavior of --cpuset-cpus option in Linux.
@shin- Hi Joffrey,
It is very important issue for Windows Server 2016 containers as --cpus/–cpu-count/–cpu-percent parameters is the only way to limit cpu consumption. So, just for now, docker-compos is not production ready for Windows containers as we can configure these parameters.
I mean docker-compose itself. Version 2.x (which I currently use) of docker-compose.yml does not support cpus parameter (–cpus for docker run). Version 3.x supports it but documentation states that docker-compose ignores section deploy: https://docs.docker.com/compose/compose-file/#deploy
Still having the issue with docker create service --cpu or ----limit-cpu not worked with windows server 2019 with docker 18.9 latest version with docker ce edition.
please help
@shin- Hi Joffrey Pull request for compose is created: https://github.com/docker/compose/pull/4835