如何测试docker的所有ulimit? [英] How can I test all ulimits of docker?

查看:158
本文介绍了如何测试docker的所有ulimit?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Docker容器当前正在无限运行...



但是,主机系统对所有内容都有限制。



如何测试它是否符合主机系统?我能以任何方式模拟最大打开文件连接等吗?



我很好奇码头工人实际上是如何分配此限制的,因为服务器受很多因素的限制,包括开放端口等等。



目前,根据我的想法...将不同的ip分配给了不同的容器...
,因此每个ip可以具有65535个端口? p>

所以这意味着docker的端口不受限制???那文件描述符呢?



有人有什么想法吗?

解决方案

Docker不会篡改ulimits,如果主机受到限制,那么容器也会一样。



容器不过是特殊进程,所以fd限制是与主机上的任何其他进程相同。



关于端口,同样的事情,如果您的主机有任何限制,Docker将不会绕过它们。它只是创建一个veth对。因此,您很可能将限制为65535个*最大veth端口。



您可以通过编写一个小程序来测试限制,该小程序将打开N个文件或N次,然后查看如果可行。


Docker containers are currently running at unlimited ulimits...

However, the host system has limits on everything.

How can I test if it is complying with the host system? Any ways I can simulate a max open file connection etc?

I'm curious how docker actually allocates this limit considering a server is limited by a lot of things including open ports etc.

Currently from what I think... there are different ips assigned to different containers... so each ips can have 65535 ports?

So that means unlimited ports for docker??? What about file descriptors?

Anyone has any ideas?

解决方案

Docker does not tamper with ulimits, if the host is limited, then the container will be as well.

Containers are nothing more than specials processes, so the fd limit is the same as for any other process on the host.

Concerning the port, same thing, if you host has any limitation, Docker will not bypass them. It just creates a veth pair. So you will be most likely limited to 65535 * max veth ports.

You can test the limit by writing a small program that will open N files or for N times and see if it works.

这篇关于如何测试docker的所有ulimit?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆