Docker Community Forums

Share and learn in the Docker community.

CPU limit for compose type version 1 - Need information

CPU resource limit in compose type version 1, Only three options are available ( cpu_shares, cpu_quota, cpuset,) and description and usage is not explained in the site.

Can you please help in giving more details, I have to limit the CPU for different container that part of big physical machine.

Hi :slight_smile:

Im not quite sure what you’re asking, there is features added to this, up til compose version 2.2

Hello Martin,

Thanks for the response.
I am using the compose version 1 (https://docs.docker.com/compose/compose-file/compose-file-v1/)
And need to do the CUP resource limits for the docker containers that created on on-premises linux machine. So that each docker container get appropriate CPU.
Now in version 1 , only three options are present to limit the CPU - cpu_shares, cpu_quota, cpuset.

cpu_shares: 73
cpu_quota: 50000
cpuset: 0,1
No documentation is available that what would be the values need to set for these , so that docker containers could get dedicated CPUs/cores

Thanks for you help and information.

Hi again,

There is some documentation about the settings here: