Docker的CPU限制限制

[root@localhost ~]# docker run --help |grep cpu
--cpu-percent int CPU percent (Windows only)
--cpu-period int Limit CPU CFS (Completely Fair Scheduler) period
--cpu-quota int Limit CPU CFS (Completely Fair Scheduler) quota
-c, --cpu-shares int CPU shares (relative weight)
--cpuset-cpus string CPUs in which to allow execution (0-3, 0,1)
--cpuset-mems string MEMs in which to allow execution (0-3, 0,1)
--cpu-period

docker run -d -e "container=docker" --net=none --privileged=true -m 1024M --cpu-period=100000 --cpu-quota=200000 -v /sys/fs/cgroup:/sys/fs/cgroup -v /home/data/logs:/home/data/logs -v /opt:/opt --name centos7.1 centos /usr/sbin/init

[root@e0dfb35f1989 /]# dd  if=/dev/zero  of=/dev/null 

  --cpu-period=100000 
    --cpu-quota=200000   占用几个CPU

    Docker的内存限制的是如果给1G  docker容器最多能用2G ,跑满2G 容器就会被kill掉
    ![](https://s1.51cto.com/images/blog/201801/07/e30678d2a5c491319722f49410ae7e49.png?x-oss-process=image/watermark,size_16,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_90,type_ZmFuZ3poZW5naGVpdGk=)

转载于:https://blog.51cto.com/wsxxsl/2058273

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值