Docker Containers Resource Share

Docker Containers Resource Share

Well, In laymen term the same machine could run multiple containers of the same application or containers of other applications.

What if resources are same. Any Impact. Let's discuss below points:

If answer is yes, then there must be few pros and cons:

Pros?-?

  • Better usage of your physical resources (CPU, Memory). For example -?
  • If the intention is auto-scaling for example, it makes sense to have more than one container on the same host.
  • Saves money, as a single host running multiple containers will be less costly than spreading them across multiple hosts.

Cons?-?

  • The physical resources available changes over time. This happens a lot in an elastic environment where resource sharing can flex/ between few and many containers.
  • Containers impact each other because they are competing for system resources.

If answer is NO, then what?

  • It will probably cost you more money. Because you may be wasting resources while your container is waiting for an IO operation.

Conclude -??Resources could be wasted when it comes to-?

  • IO-bound applications where the CPU isn’t used the most of the time.
  • Batch operations, where your application runs in a scheduled way and sits idle between batches.

So after conclude do not fixed resources of any container, as you will need to run performance tests to better understand your resources constraints and utilization.??

Add on - In any case you come up with the results of performance testing. So How you can set the limits of infrastructure/hardware limit.

What we need to do is - Let's run a simple docker command for file descriptors, memory limit and CPU Limit:

docker run -it --ulimit nofile=<file_discriptor_limit> --memory=<memory_limit> --cpus=<cpu_limit> --appname=<app_name> <appimage>

Caution - Hope you have the performance results.?

For More Blogs please refer to the https://vipuldhingra.blogspot.com and you can DM me over the linkedin.

要查看或添加评论,请登录

Vipul Dhingra的更多文章

  • For Technical readers

    For Technical readers

    If you are a technical reading lover. visit this blogs site once.

社区洞察

其他会员也浏览了