Questions about common user Ulimit max user processes value in CentOS 7

Source: Internet
Author: User

Recently, in a project to the Tomcat test, the normal user started Tomcat when the pressure will be reported java.lang.OutOfMemoryError error, this error is the system max user processes Problem.




When I landed on the server to view the ulimit of the system

 ulimit -a core file size           (blocks, -c)  0data seg size             (kbytes, -d)  unlimitedscheduling priority               (-E)  0file size                 (blocks, -f)  unlimitedpending signals                   (-i)  514585max  locked memory        (kbytes, -l)  64max memory size           (kbytes, -m)  unlimitedopen files                         (-N)  655360pipe size             (512  BYTES, -P)  8POSIX message queues      (bytes, -q)   819200real-time priority                (-R)  0stack size                (kbytes, -s)  8192cpu time                 (SECONDS, -T)  unlimitedmax user processes                (-u)  514585virtual memory            (KBYTES, -V)  unlimitedfile locks                         (-X)  unlimiteD 


Found that there is no problem, it is strange that the problem has been troubling for a long time, have not found the problem.


Later we used the root user to start Tomcat, then the pressure test, found that the problem has been resolved, no longer appear

Java.lang.OutOfMemoryError's error.


is the root user not the same value as the normal user Ulimit?


This time we switch to the normal user, to view the system's Ulimit discovery


core file size           (blocks, -c)   0data seg size            (kbytes, -d)  unlimitedscheduling priority               (-E)  0file size                 (blocks, -f)  unlimitedpending signals                   (-i)  514585max locked memory         (kbytes, -l)  64max memory size           (kbytes, -m)  unlimitedopen files                        (- N)  655360pipe size             (512 bytes, -p)  8POSIX  message queues      (BYTES, -Q)  819200real-time priority                (-R)  0stack size                (kbytes, -s)   8192cpu time                ( SECONDS, -T)  unlimitedmax user processes                (-u)  4096virtual memory            (KBYTES, -V)  unlimitedfile locks                        (-X)   Unlimited


Why is the value of MAX user processes only 4096 for a normal user? So where does this value control from?


According to the truth, Ulimit values are modified by/etc/security/limits.conf, but we have made changes to/etc/security/limits.conf, but the value of max user processes is What's the difference?


Later we found that the value of the nproc below Ulimit is controlled by the/etc/security/limits.d/20-nproc.conf file. We view/etc/security/limits.d/20-nproc.conf file


# Default limit for number of user ' s processes to prevent# accidental fork bombs.# See Rhbz #432903 for reasoning.* Soft Nproc 4096root Soft Nproc Unlimited


Questions about common user Ulimit max user processes value in CentOS 7

Related Article

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.