首页 > 解决方案 > 给 docker 分配多少资源

问题描述

我已经使用 docker 玩了几个月了,现在我们已经准备好运行一些生产容器,这让我开始研究基础设施。

它让我想到了一个问题,我需要为 docker 分配多少资源以及应该为操作系统留多少资源。

例如,我的服务器是 8 核 16GB 内存。我应该分配多少给 docker?我显然想分配最大可能,但是在什么时候它自己的服务器性能会下降?

标签: docker

解决方案


Your question is hard to answer, and here's why: "docker" itself doesn't really require much in the way of resources. On the other hand, the applications that you run using docker will have their own requirements.

For example, if you're hosting a multi-terabyte database in a docker container, you're going to require more memory (and probably a lot more storage) than you would for, say, a single wordpress site.

If you're hosting some sort of video transcoding pipeline in Docker, you might end up consuming a lot more of your available CPU.

The only resource that Docker really consumes on its own is the storage space for images and volumes...and again, how much space you need is entirely dependent on how you're using Docker.

It all depends on exactly what you plan on doing with your system.


推荐阅读