About the nproc restrictions of ulimit in RHEL6

Source: Internet
Author: User
Ulimit is used to restrict the resources occupied by shell startup processes. It supports the following types of restrictions: the size of the created Kernel File, the size of the process data block, the size of the file created by the Shell Process, the size of the Memory Lock, the size of the resident memory set, the number of opened file descriptors, And the allocation stack. the maximum size, CPU time, the maximum number of threads for a single user, and the maximum virtual memory that a Shell process can use. At the same time, it supports restrictions on hard and soft resources. For more information about Linux file descriptors, see my previous article: http:

Ulimit is used to restrict the resources occupied by shell startup processes. It supports the following types of restrictions: the size of the created Kernel File, the size of the process data block, the size of the file created by the Shell Process, the size of the Memory Lock, the size of the resident memory set, the number of opened file descriptors, And the allocation stack. the maximum size, CPU time, the maximum number of threads for a single user, and the maximum virtual memory that a Shell process can use. At the same time, it supports restrictions on hard and soft resources.

Linux file descriptor can see the author's previous article: http://www.linuxidc.com/Linux/2012-08/68607.htm

Concerning the nproc restrictions of ulimit in RHEL6, RHEL6 and RHEL5 have some differences in details:

V \: * {behavior: url (# default # VML);} o \: * {behavior: url (# default # VML);} w \: * {behavior: url (# default # VML );}. shape {behavior: url (# default # VML);} change the number of processes that a user can open in the Current shell

As a temporary limit, ulimit can be used to log on to shell sessions by using its command. The limit ends when the session ends and does not affect other shell sessions.

Modify the limits. conf configuration file to take effect.

[Root @ www.linuxidc.com ~] # Ulimit-a // view the global coefficient of the current configuration file ulimit

Core file size (blocks,-c) 0

Data seg size (kbytes,-d) unlimited

Scheduling priority (-e) 0

File size (blocks,-f) unlimited

Pending signals (-I) 1829

Max locked memory (kbytes,-l) 64

Max memory size (kbytes,-m) unlimited

Open File (-n) 1024

Pipe size (512 bytes,-p) 8

POSIX message queues (bytes,-q) 819200

Real-time priority (-r) 0

Stack size (kbytes,-s) 10240

Cpu time (seconds,-t) unlimited

Max user processes (-u) 1024

Virtual memory (kbytes,-v) unlimited

File locks (-x) unlimited

[Root @ www.linuxidc.com ~] # Vim/etc/security/limits. conf

[Root @ www.linuxidc.com ~] # Grep '^ *'/etc/security/limits. conf

* Soft nproc 10240

* Hard nproc 10240

* Soft nofile 10240

* Hard nofile 10240

[Root @ www.linuxidc.com ~] #

Log out of the current user and log on again to make the modified limits take effect.

[Root @ www.linuxidc.com ~] # Ulimit-n

10240

[Root @ www.linuxidc.com ~] # Ulimit-u // It is found that nproc has not changed like nofile

1024

[Root @ www.linuxidc.com ~] #

The configuration file/etc/security/limits. d/90-nproc.conf is introduced in RHEL6.

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.