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
Lists are used to list a series of similar or rela...
1. Pull the image docker pull registry.cn-hangzho...
Use of AES encryption Data transmission encryptio...
If I want to make the form non-input-capable, I se...
Table of contents summary Overall process front e...
Open the decompressed directory of tomcat and you...
Preface Mobile devices have higher requirements f...
Table of contents Date Object Creating a Date Obj...
Linux uses iftop to monitor the traffic of the ne...
Those who have played King of Glory should be fam...
Nextcloud is an open source and free private clou...
Introduction: Interface designer Joshua Porter pub...
Table of contents Background Configuring DHCP Edi...
Today I recommend such an open source tool for ex...
Chatbots can save a lot of manual work and can be...