1. --cpu=<value> 1) Specify how much available CPU resources a container can use, but do not allow the container to always run on one or a few CPUs 2) For example, if the host has 2 CPUs and you set --cpus="1.5", you can declare that the container can use half of the CPUs, which is equivalent to setting --cpu-period="100000" and --cpu-quota="150000" Start the centos base image in a 4-core server and set it to use 1 core CPU docker run -itd --cpus="1" --name=centos centos7 /bin/bash Enter the container and start the 4-core CPU test View the resource status of the container docker stats 08e1adecf3b7 Check the server's CPU resources (because the test server is also in use by other services, the CPU resource ratio is extremely high, normally around 25%) top 2. --cpuset-cpus=<value> 1) Limit the container to use a specific CPU or core 2) Containers can use a comma-separated list or a hyphen-separated list of CPU ranges. The first CPU is numbered 0, and valid values may be 0-3 (use the first, second, third, and fourth CPUs) or 1,3 (use the second or fourth CPU) 3. --cpu-period=<value> 1) Specify the CPU CFS scheduler period, which is used together with --cpu-quota. 2) The default value is 100000 microseconds (100 milliseconds). Most users do not change the default settings. For most use cases, --cpus is a more convenient alternative 4. --cpu-quota=<value> 1) Set COU CFS quota 2) For large number use cases, --cpus is a more convenient alternative 5. --cpu-shares 1) Set CPU weight. The default value is 1024. 2) When CPU resources are sufficient, it does not make sense to set CPU weights. Only when containers compete for CPU resources, CPU weights can make different CPU usage This is the end of this article about the implementation of docker CPU limit. For more relevant docker CPU limit content, please search 123WORDPRESS.COM's previous articles or continue to browse the following related articles. I hope everyone will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: CenOS6.7 mysql 8.0.22 installation and configuration method graphic tutorial
>>: How to use Lottie animation in React Native project
Usage scenario: We use Alibaba Cloud and purchase...
Table of contents Transaction Isolation Level Pro...
1. Download the Linux version from the official w...
1. AIDE AIDE (Advanced Intrusion Detection Enviro...
In this article, I will show you how to develop a...
This article introduces how to build a high-avail...
Reasons why the 1px line becomes thicker When wor...
Menu bar example 1: Copy code The code is as foll...
1. Open the virtual machine and git bash window a...
Result:Implementation Code html <div class=...
Today I had a sneak peek at IE8 beta 1 (hereafter...
1. Download related tools and images Download Lin...
Do you add an alt attribute to the img image tag? ...
1. Download the download link Click download. You...
This article shares the specific code for WeChat ...