LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   max processes run in linux (https://www.linuxquestions.org/questions/linux-general-1/max-processes-run-in-linux-821656/)

pradiptart 07-23-2010 05:02 AM

max processes run in linux
 
I am very new to this.

I want to know what is the maximum no of processes that can be run in Linux ,as it is a multitasking so what is the limit of this.

some one told me that 8192 but why this not 10000 or 500 why 8192.

please help me I don't able to find the answer.. i have searched in google but do not find any ans ..

saifkhan123 07-23-2010 05:40 AM

8192 is not the limit for linux, its the limit for a particular user. You can find the limit by typing
Code:

ulimit -u
The actual limits of a Linux 2.6 kernel are
Quote:

Maximum process or threads for Linux kernel 2.6

* Maximum number of threads: 32000
* Maximum number of threaded processes: 32000
* Maximum number of processes: 32000

pradiptart 07-23-2010 05:54 AM

Thank u
can u say why this is 8192 for a perticular user..

salasi 07-23-2010 07:10 AM

Quote:

Originally Posted by pradiptart (Post 4042827)

some one told me that 8192 but why this not 10000 or 500 why 8192...can u say why this is 8192 for a perticular user..

Well, a the time that it was selected 8192 was felt to be a big enough number not to cause problems. Do you have a use case in which this is not true?

It would also have been selected as a convenient number for the computer. Have you thought about what this might mean?

MTK358 07-23-2010 07:12 AM

Computers use binary, not decimal.

Numbers like 2, 64, 256, or 8192 are even for a computer because hey are powers of 2.

Numbers like 500 or 1000 look as uneven to a computer as 8192 looks to you!

pradiptart 07-23-2010 07:51 AM

Why 8192 processes not more or less
 
Sir ,
I want to know is there any reason behind that,
As MTK358 given that computers use power of 2, I accept that
but there are other nos also as 512,1024,2048.. and so on

my question is why 8192 not more than or less than this.

GrapefruiTgirl 07-23-2010 08:11 AM

I cannot precisely answer post #6, but wanted to provide a little more on the subject in general:

It should be noted that `ulimit` is actually a Bash built-in command (see the Bash manpage for details on ulimit) and, for the record, on my 64bit Slackware system, max user processes is not 8192, but 31700.

Here's all ulimit output:

Code:

sasha@reactor: ulimit -a
core file size          (blocks, -c) unlimited
data seg size          (kbytes, -d) unlimited
scheduling priority            (-e) 0
file size              (blocks, -f) unlimited
pending signals                (-i) 31700
max locked memory      (kbytes, -l) 64
max memory size        (kbytes, -m) unlimited
open files                      (-n) 1024
pipe size            (512 bytes, -p) 8
POSIX message queues    (bytes, -q) 819200
real-time priority              (-r) 0
stack size              (kbytes, -s) 8192
cpu time              (seconds, -t) unlimited
max user processes              (-u) 31700
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited
sasha@reactor:

I dunno if I have something somewhere that altered the default, or if maybe 8192 is no longer a common limit for max user processes, but maybe the OP should examine `ulimit` on his/her own machine, and see what it says?

david1941 07-23-2010 09:17 AM

All processes run under a parent (the first one is usually "init", run by root at boot-up). The parent can set limits on what the child can do or use. There is a difference in what an ordinary user or root can do, however, and some certain limits can only be altered by the root user. I think of it like human parent might set a bedtime limit for a child (human children don't HAVE to follow parent set limits, but process children MUST). The limits are initially set to values deemed appropriate for the system (bedtime at 9:00 PM) and a child can set additional limits below that but not higher (say 8:00 PM), and can set them "soft" or "hard". Soft limits can be reset by the child's children but limited to the hard limits.

This allows a process to control what access to system resources a child process has. For a list of what can be set see man limit. My Fedora 11 system shows max user processes at 36,864 (which cannot be increased by a non-root user), but could easily be changed by a root user:
Code:

[root@maplepark ~]# ulimit -a
core file size          (blocks, -c) 0
data seg size          (kbytes, -d) unlimited
scheduling priority            (-e) 0
file size              (blocks, -f) unlimited
pending signals                (-i) 36864
max locked memory      (kbytes, -l) 64
max memory size        (kbytes, -m) unlimited
open files                      (-n) 32384
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@maplepark ~]# ulimit -u 147456
[root@maplepark ~]# ulimit -a
core file size          (blocks, -c) 0
data seg size          (kbytes, -d) unlimited
scheduling priority            (-e) 0
file size              (blocks, -f) unlimited
pending signals                (-i) 36864
max locked memory      (kbytes, -l) 64
max memory size        (kbytes, -m) unlimited
open files                      (-n) 32384
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) 147456
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited
[root@maplepark ~]#

The fact that I set max user processes to 147456 above does NOT mean my system will actually function that way, as setting a child's bedtime of 9:00 does not mean sleep will occur at 9:00. It only means I have set a limit that child processes must honor. "Honor thy parent" is actually enforced by computer processes.


All times are GMT -5. The time now is 08:25 PM.