soft and hard limits for nproc value in /etc/security/limits.conf file
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
soft and hard limits for nproc value in /etc/security/limits.conf file
OS version : RHEL 6.5
Below is an excerpt from /etc/security/limits.conf file for OS User named appusr in our server
appusr soft nproc 2047
appusr hard nproc 16384
Question1.
What will happen if appusr has already spawned 2047 processes and wants to spawn 2048th process ?
I just want to know the impact of breaching the soft limit of 2047
Question2.
In Linux , is there any way I could quickly spawn/fork n number of dummy processes using a loop or something?
Question 1 has been answered in another thread HERE by way of saying that the soft limit merely means it is software adjustable, you cannot create processes beyond that limit value.
For question 2, yes you can, write some C code in a limiting loop to use and re-use fork() to create processes. Check the return code from fork(), keep track of how many processes you have created, and check errno for cases when things fail.
Regarding Question1.
Didn't quite understand what you meant by "soft limit merely means it is software adjustable, you cannot create processes beyond that limit value" .
Isn't that a mutually contradicting statement ?
Regarding Question1.
Didn't quite understand what you meant by "soft limit merely means it is software adjustable, you cannot create processes beyond that limit value" .
Isn't that a mutually contradicting statement ?
If you review the former question, the OP incorrectly had the impression that soft limit was some sort of warning point. They tested and found that soft limit was a true limit, and so their conjecture was that "soft" was not soft at all, but instead the same as hard. The correction was to explain to them that the limit is a true governor, however that the limit can be adjusted by changing system settings. See limits.conf(5) and observe ulimit(1) with the -u option.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.