V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
DinoStray
V2EX  ›  问与答

对于 open files 限制, 宿主机和 docker, 是互相独立的么?

  •  
  •   DinoStray · Oct 11, 2021 · 815 views
    This topic created in 1662 days ago, the information mentioned may be changed or developed.

    宿主机操作系统 和 docker 镜像, 版本都是 ubuntu 20.04
    使用 ulimit -a
    宿主机: open files (-n) 1024
    docker 里面: open files (-n) 1048576

    这两个是完全独立的么? 互不影响?

    1 replies    2021-10-12 17:12:32 +08:00
    julyclyde
        1
    julyclyde  
       Oct 12, 2021   ❤️ 1
    首先 ulimit 是针对“本 shell”的,你这个查看方法就不对

    具体生效的值,需要查看 /proc/PID/limits 的内容
    生效关系是从宿主机的 1 号( root 权限)开始,层层设置和继承下来的
    https://julyclyde.org/?p=578
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2442 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 05:10 · PVG 13:10 · LAX 22:10 · JFK 01:10
    ♥ Do have faith in what you're doing.