zoukankan      html  css  js  c++  java
  • Increase ulimit in ubuntu and docker

    What is ulimit?

    It is a number of open file descriptors per process. They can all refer to the same file, or different files. It prevent single users from using too many system resources.

    How can is check ulimit in current shell?

    Run ulimit -a command from terminal.

    Output of the above command:

    How to set ulimit in current shell?

    ulimit -n {$no of files}

    For example -> If you want to set no of open files 65535 below is the command you need to run on terminal. ulimit -n 65535 ;

    How to set ulimit permanent?

    For the ulimits to persists across reboots we need to set the ulimit values in the configuration file

    /etc/security/limits.conf.

    Format ->

    #[domain]   [type]  [item]  [value]

    domain → a user name or group name

    type -> can have the two values (soft| hard)

    item -> the property to set

    value -> value of the property.

    For example -> to add limit of number of files for user root:

    to set limit of number of files valid for all users:

    How to set ulimit in Docker?

    Due to some security reason. docker currently not extends host ulimit property.

    There are couple of ways to set following are the ways:

    • The latest docker supports setting ulimits through the command line and the API. For instance, docker run takes — ulimit <type>=<soft>:<hard> .
    • set ulimit -n 65535 in the file /etc/init.d/docker
  • 相关阅读:
    asp .net 页面回车触发button 按钮事件
    Asp.netPost&Get转
    2012.8.16近期总结,1模态窗口回传重新被弹出2,清空缓存 3,
    面试感言
    2012.6.27近期总结,1.sql字符串转换(cast,CONVERT )调用wcf服务,关闭模态窗口刷新付页面
    self
    空指针
    枚举和结构体
    typedef
    指针
  • 原文地址:https://www.cnblogs.com/ExMan/p/12983284.html
Copyright © 2011-2022 走看看