Ulimits in Docker host vs container

前端 未结 3 2066
后悔当初
后悔当初 2021-01-31 18:20

I wasn\'t able to find straight answer, to this question, but here it is:

Let\'s say that I have a host which has max open files 1024:

[root@host]# ulimit          


        
3条回答
  •  北海茫月
    2021-01-31 19:12

    The real limit will be 1048576.

    Have a look at the right part of this image, which shows that containers are basically just isolated processes, running on the same operating system:

    As every system call in the container will be handled directly by the host OS, the ulimit that is displayed (1048576) comes directly from the host OS and that is the value that will be used.

    The difference in the ulimits could have been caused by a Docker configuration, for example.

    (Note that for VMs, this will be different: The guest OS might display a value of 1048576, but the open calls will in the end be handled by the host OS, which will impose the limit of 1024)

提交回复
热议问题