Adjust the number of processes opened by Linux users and the number of linux Processes

Source: Internet
Author: User

Adjust the number of processes opened by Linux users and the number of linux Processes
How to adjust the number of processes opened by Linux Users

References:

About nproc limits for ulimit in RHEL6 (http://www.cnblogs.com/kumulinux/archive/2012/12/16/2820609.html)

!! The content of this article is only tested on RHEL6.4. This article only applies to all users

1. view the nproc (max user processes) command

[root@vm-cdh4 ~]# ulimit -u14866

2. Modify nproc

Temporary modification. expired upon logon or restart:

[root@vm-cdh4 ~]# ulimit -u 32768
[root@vm-cdh4 ~]# ulimit -u
32768

Try/Etc/security/limits. confAdd the following Configuration:

*    soft    nproc     32768

Log out of the current user, log on again or restart, and check that the configuration is still invalid.

Continue to try/Etc/security/limits. d/90-nproc.confAdd Configuration:

*    soft    nproc     65536
Log out of the current user, log on again or restart, and check that the configuration is still invalid.

Continue to try/Etc/security/limits. d/90-nproc.confAdd Configuration:

* soft nproc 65536* hard nproc 65536
After logging on again or restarting, check that the configuration has taken effect. We can see that hard nproc works.

3 conclusion

Temporary modification (no restriction in shell. xxx can be any number, which indicates that this modification is meaningless ):

# ulimit -u xxx

Permanent modification. The insurance policy is modified at the same time. /Etc/security/limits. d/90-nproc.confAnd /Etc/security/limits. confAs follows:

Limits_conf =/etc/security/limits. conf:

*   soft   nproc    s1*   hard   nproc    h1

Nproc_conf =/etc/security/limits. d/90-nproc.conf:

*   soft    nproc    s2*   hard    nproc    h2

S1, h1, s2, h2 must be a meaningful number. At this time, the value displayed by ulimit-u is = min (h1, h2)

Therefore, we usually set s1 = s2 = h1 = h2. For exampleLimits_confAndNproc_confAdd:

*   soft   nproc   16384*   hard   nproc   16384

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.