[Linux] Limitations on the number of Ulimit Nproc user processes in CENTOS6

Source: Internet
Author: User

First, Reason:

In the start MongoDB, there is warning hint soft rlimits too low, that is, the user process is too small, so the system resources on the maximum number of users of the limit ulimit-u.

Let the setting take effect temporarily, Ulimit-u 102400, prompt: Ulimit:max user processes:cannot Modify limit:operation not permitted.

Modify/etc/security/limits.conf to * soft Nproc 102400, exit the shell and re-login, still not. After Google is/etc/security/limits.d/90-nproc.conf

The limit is in CentOS 6.

Second, the solution:

In the file 90-nproc.conf, the default limit for number of user's processes to prevent is interpreted, which is visible to limit the user's maximum process count.

after viewing, the Nproc per user (*) is limited to 65535, so setting 100000 exceeds the maximum number of system user process limits.

 for number of user's processes to prevent# accidental fork bombs.# See Rhbz #43290 3 for reasoning.     65535    65535  

therefore need to modify 90-nproc.conf to soft Nproc 100000, re-login can be effective.

Alternatively, if you are only restricting changes relative to a single user, you can modify the/etc/security/limits.conf, and change the * to a specific user name is also valid.

Like what:

Mongod Soft Nproc 100000
Mongod Hard Nproc 100000

Note: The landlord has tried to set the value of Nofile in 90-nproc.conf, also can be effective, the system to him as the standard;

third, on the Linux user resource limitations limits.conf detailed

1. The limits.conf file is actually a pam_limits.so configuration file in the Linux PAM (authentication module) and is only for a single session.

2, for the limits.conf file configuration to take effect, you must ensure that the pam_limits.so file is added to the startup file. To view/etc/pam.d/login files have the session required/lib/security/pam_limits.so

The limits.conf file format is as follows:

<domain> <type> <item> <value>

There are several formats for domain, which can be viewed with cat limits.conf, but generally we use the form of usernames and group names: username| @groupname

Set the user name that needs to be restricted, the group name is preceded by the @ and the user name differs. You can also use wildcard characters * to make all the restrictions.

Type: Soft,hard and-,soft refer to the setting value that the current system is in effect for, and the soft limit can also be interpreted as a warning value. The maximum value that can be set in the hard table name System. The soft limit cannot be higher than the hard limit,

Use-Indicates that both soft and hard values are set.

Item indicates the type of usage resource that needs to be restricted

Core limits the size of kernel files

Data maximum size

Fsize Maximum file size

Memlock Maximum lock memory address space

Nofile Maximum number of open files

RSS Max Persistent setting size

Stack maximum stack size

Maximum CPU time in minutes for CPU

Maximum number of noproc processes

As address space limitations

Maxlogins the maximum number of logins allowed for this user

[Linux] Limitations on the number of Ulimit Nproc user processes in CENTOS6

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.