Docker's Cgroup Chapter

Source: Internet
Author: User

# Docker--version Docker version 1.10.3, build f476348/1.10.3 as an example of 1.10.3, with the following Cgroup-related option:
--blkio-weight                   Block IO  (relative weight),  between 10 and 1000-- blkio-weight-device=[]        block io weight  (relative  device weight)--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)   --device-read-bps=[]             Limit read rate  (Bytes per second)  from a  Device--device-read-iops=[]           limit read  rate  (Io per second)  from a device--device-write-bps=[]            Limit write rate  (Bytes per second)  to a device--device-write-iops=[]           Limit write rate  (Io per second)  to a device-m, --memory                     Memory  limit--memory-reservation            memory  soft limit--memory-swap                    Swap limit equal to memory plus swap:  ' -1 '  to enable unlimited swap--oom-kill-disable               disable oom killer


The Cgroup subsystem Blkio is used to limit the block I/O bandwidth

--blkio-weight---set a weight value, in the range of 100-1000, which is similar to Cpu.shares, is the weighting allocation, not the denied bandwidth limit, so this set value only takes effect when different subsystems compete for the bandwidth of the sub-resources.


--blkio-weight-device=[] is a weight value for a specific device that overrides the value of-blkio-weight ex: use Cgroup to set the/DEV/SDA weight to the minimum #echo 8:0 > Blkio.weight_device


CPU SUBSYSTEM:

--cpu-shares is the proportional weight that allocates the CPU, ex:512/1024 the latter can get 2/3 CPU running time, of course, when there is contention, the value of this allocation will not take effect, generally do not work. --cpu-period/--cpu-quota The two option is generally used in combination, can be set to 1 seconds using--cpu-period, and then--cpu-quota Set to 0.5 seconds, the process in Cgroup will run for up to 0.5 seconds in 1 seconds and then be forced to sleep until the next 1-second time fragment--cpuset-cpus allowed to use the list of CPUs, for example: 0-3,10 ( Mainly look at the number of CPUs on the server and the number of cores, LSCPU can see the list of memory nodes that--cpuset-mems allows the process to use, for example: 0, 1 mainly manually utilize the memory nodes that the Cgroup control process can access, Prevents excessive CPU usage across memory and slows down the entire machine

Device Subsystem

--device-read-bps=[] Set the bandwidth limit of read disk per second, you need to specify device--device-read-iops=[] set the maximum IOPS per second read disk, you need to specify the device--device-write-bps =[] Set the maximum disk bandwidth per second, specify device--device-write-iops=[] to set the maximum IOPS per second of write disks, you need to specify the device


-M,--memory limits the Cgroup control process to use the upper limit of Memroy, hard limit (never exceeding this value)--memory-reservation soft limit memory use, You can exceed this value--memory-swap limit the size of the swap memory used by Cgroup-controlled processes, where the value corresponding to this option is memory + swarp and
--oom-kill-disable turn on this switch, then when the process uses more memory than the hard limit limit, it triggers the system's oom and kills a process (typically the most memory-using process)


This article is from the "Crab" blog, please make sure to keep this source http://realsilsa.blog.51cto.com/8240339/1827524

Docker's Cgroup Chapter

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.