It's plausible that machines in a cluster have different numbers of cores. Docker Swarm mode's deploy.resources.limits.cpus
config specifies the absolute number of cores. Is it possible to specify a percentage of the total available CPU resources? I want the total CPU limit to be close to 100% of the max capacity.
dockerfile snippet:
deploy:
resources:
limits:
cpus: '1'
memory: 4G
1条答案
按热度按时间pxiryf3j1#
没有。
如果您的服务实际上可以从多个核心中获益,请将cpu限制设置为节点可用的最小和最大核心的合理公约数,然后将副本设置为一个数字,使deploy. replica * deploy.resource.limits.cpus ~= total-swarm-cpus。