我正在使用Docker创建本地开发环境,以开发Magento模块。在大多数操作期间,Magento非常缓慢,我注意到的是,每个核心的CPU使用率不会超过20%(我的机器有8个核心)。
有没有设置可以更改,以便给Docker容器提供更多的CPU资源使用?
有没有设置可以更改,以便给Docker容器提供更多的CPU资源使用?
使用 docker run
命令时,您可以传递有关资源的自定义参数。
例如:
--cpu-shares CPU shares (relative weight)
--cpu-period Limit CPU CFS (Completely Fair Scheduler) period
--cpu-quota Limit CPU CFS (Completely Fair Scheduler) quota
--cpuset-cpus CPUs in which to allow execution (0-3, 0,1)
--cpuset-mems MEMs in which to allow execution (0-3, 0,1)
1.11.1
,我不记得了,但也许某些参数只能在更新的版本中使用。docker stats
显示容器,但所有值(CPU、MEM等)都为0。 - Luigi T.
docker stats
命令来检查。 - user2915097