LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This 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


Reply
  Search this Thread
Old 07-13-2015, 04:53 AM   #1
kraljic
LQ Newbie
 
Registered: Jul 2015
Posts: 4

Rep: Reputation: Disabled
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?

Last edited by kraljic; 07-13-2015 at 05:07 AM.
 
Old 07-13-2015, 05:50 AM   #2
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,882
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
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.
 
1 members found this post helpful.
Old 07-13-2015, 07:43 AM   #3
kraljic
LQ Newbie
 
Registered: Jul 2015
Posts: 4

Original Poster
Rep: Reputation: Disabled
Hi Rtmistler,

Thank you for answering Question2.

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 ?
 
Old 07-13-2015, 08:13 AM   #4
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,882
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
Quote:
Originally Posted by kraljic View Post
Hi Rtmistler,

Thank you for answering Question2.

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.
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Soft limits and hard limits of process gaurav_s Linux - Software 4 01-06-2015 09:57 AM
[SOLVED] limits.conf + nproc weirdness zQUEz Linux - Server 2 11-06-2013 12:48 PM
[SOLVED] How to set open file descriptor hard and soft limits Z038 Slackware 3 06-16-2013 11:37 PM
Setting limits in /etc/security/limits.conf vaibhav.vsk Linux - Security 1 09-20-2012 08:22 AM
getrlimit is setting soft and hard limits to -1, why? FunkMeisterMaz Programming 2 03-22-2004 06:34 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:43 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration