How To Increase CPU In a Running Docker Container

We’ are always concern about the performance of Docker containers where three terms matter a lot which is CPU, Memory & Block I/O. If you’re having huge traffic on the container. So you need to look at those terms in order to improve docker container performance. Let’s see how to increase CPU ram set docker and increase docker container memory and also check the status, docker increase memory in Linux.

How To Increase CPU In a Running Docker Container:

You can also use the docker-compose file to perform these tasks using the script and run with the docker-compose command. The file is written in YAML.

Check OutDocker Memory Limit

In Docker, CPU-share is a relative weight, which is default 1024. You
increase or set the CPU limit by using any number within 1024. 

For more details, you may read here CPU info

As you can I have already run two containers on docker-machine. The default CPU allocated by Docker is 0.11% in running containers. Now I’m going to increase it by 0.05% which is 512 in numbers.

docker ps

increase docker container memory

Check stats of mysqltest container

docker stats mysqltest –no-stream

cpu ram set docker

Check Out: Create Container

Now I have increased it by 512. You may either use -c or –cpu-shares=number

docker update -c 512 mysqltest

docker increase memory linux


docker stats mysqltest –no-stream

Check Out: Docker Service Start to Failed

check docker container status

YouTube Link: Increase CPU in Running Container

You’re done  cpu ram set  increase memory linux check docker container status

Share on:

I'm the founder of Curious Viral. I hope this blog will provide you complete information about Linux Technology & I would like to share my technical knowledge with you which I have learned during this period.

Other Posts You May Like...

Leave a comment