Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 03-16-2017, 01:16 PM   #1
Registered: Nov 2015
Posts: 397

Rep: Reputation: Disabled
CentOS 7: ulimit using "strange" value.

The hard and soft ulimits for "max user processes"
is 3889.
But in 20-nproc.conf , it is 4096 and unlimited.
Where does the 3889 come from?

$ ulimit -u
$ ulimit -a | grep -i process
max user processes              (-u) 3889
$ ls
$ cat 20-nproc.conf 
# Default limit for number of user's processes to prevent
# accidental fork bombs.
# See rhbz #432903 for reasoning.

*          soft    nproc     4096
root       soft    nproc     unlimited

$ ulimit -H -u

#Nothing is set in in /etc/security/limits.conf
Old 03-16-2017, 07:46 PM   #2
Registered: Apr 2016
Posts: 510

Rep: Reputation: 58
mine reads a different value and i had not set it to any

/* maxchild = sysconf (_SC_CHILD_MAX); */

it's likely based on either who built bash (if they put in a hard limit), your system or kernel headers (if they aren't incorrect - they can get mangled)


# sysctl -a

the real answer should be that it was taken from kernel resources and depends on more than one resource (ie to run a process you need enough kernel resources to use that process at least for forking) - but likely the setting is simply "somewhat arbitrary"

but you'll have to either use sysctl and set it yourself, or read the source and compile bash the way you want it, if you want to set a limit given some agenda (ie, a ulimit design for limiting max telnet logins a shell spawns - far different from kernel child limit)


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How can i show usage of the ulimit "open files" and why this is important? postcd Linux - General 6 03-16-2017 11:59 AM
"Difference between centos and slackware" and "also how to install scratch on centos" vijayendra.uppalapati Slackware 4 07-12-2012 11:10 PM
Setting "ulimit" is Not Working and Throwing Errors devUnix Solaris / OpenSolaris 8 02-13-2012 01:04 PM
"Difference between centos and slackware" and "also how to install scratch on centos" vijayendra.uppalapati Slackware 2 01-23-2011 03:14 AM
Strange "characters" appearing in auto "created" man pages Sector11 Linux - General 7 02-28-2010 11:05 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:38 PM.

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