反馈已提交

网络繁忙

You are viewing 5.1 help doc. More details are displayed in the latest help doc.

Max Number of Processes in Linux

  • Recent Updates: August 25, 2022
  • I.Description

    In the Linux system, you can set restrictions on the use of resources, such as the number of processes, the number of file handles, and the number of connections.

    When using the Linux system, if the root user is switched to the normal user, the resource temporarily unavailable error may occur, because the number of processes of the current user exceeds the limit. Therefore, you need to manually modify the maximum number of processes in the Linux system.

    II. Key value

    nproc: represents max number of processes, which is the limit of the operating system level on the number of processes created by each user.

    nofile: indicates max number of open file descriptors, which is the limit of the number of files that can be opened by each process.

    hard/soft: soft is a warning value, while hard is a real threshold value. If it exceeds, an error will be reported.

    III. Modification method

    1. view the maximum number of processes opened by the current user

    1) Execute the command ulimit -a on the Linux terminal

    Check max user processes: that is, the system limits the maximum number of processes or threads that can run under a user. As shown in the following figure:

    1576054140646976.png

    2) You can also execute the command ulimit - u on the Linux terminal.

    2. log in as root

    Method 1:

    Enter /etc/security/limits.conf file, add the following code and save it:

    roxy soft nproc 10240
    roxy hard nproc 10240
    roxy soft nofile 10240
    roxy hard nofile 10240

    Note: roxy is the user name that needs to modify the number of threads, and 10240 is the set limit of the number of processes and files, which can be modified as needed.

    Method 2:

    1) Enter /etc/security/limits.conf file, add the following code and save it:

    * soft nproc 10240  
    * hard nproc 10240

    Note: * means it is effective for all users.

    2) Enter  /etc/security/limits.d/xx-nproc.conf file, add the following code and save it:

    * soft nproc 10240

    Note: 1. 10240 is the set limit of the number of processes and files, which can be modified as required.

    Note: 2. The file path to be modified in cemtos6 is / etc / security / limits.d/90-nproc Conf, the file path to be modified in centos7 is / etc / security / limits.d/20-nproc conf 。

    3.log in the user who exceeds the thread limit again

    Execute ulimit -a on the terminal to view the maximum number of processes or threads that can be run under the modified system limit of a user.

    Attachment List


    Theme: Deployment Integration
    Already the First
    Already the Last
    • Helpful
    • Not helpful
    • Only read

    售前咨询电话

    400-811-8890转1

    在线技术支持

    在线QQ:800049425

    热线电话:400-811-8890转2

    总裁办24H投诉

    热线电话:173-1278-1526

    文 档反 馈

    鼠标选中内容,快速反馈问题

    鼠标选中存在疑惑的内容,即可快速反馈问题,我们将会跟进处理。

    不再提示

    10s后关闭