The maximum number of processes in Linux

What is the maximum limit on the number of processes available on a Linux system? How can we find him?

+53
linux process operating-system
Feb 20 2018-12-12T00:
source share
4 answers

The kernel should export this information to procfs :

 cat /proc/sys/kernel/pid_max 

This is the maximum number of unique process identifiers that your system can support.

Since this is a file, /proc/sys/kernel/pid_max can be checked from any capable programming language.

+44
Feb 20 '12 at 13:23
source share

sysctl kernel.pid_max

or

cat / proc / sys / kernel / pid_max

As suggested by Ninefingers.

For completeness, you can temporarily change it by writing in / proc / syskernel / pid _max or permanently by adding:

kernel.pid_max = 4194303

in / etc / sysctl.conf. 4194303 is the maximum limit for x86_64 and 32767 for x86.

+19
Aug 28 '12 at 3:13
source share

A short answer to your question: the number of processes possible in the linux system is UNLIMITED .

But there is a limit on the number of processes per user (except for root, which has no restrictions).

And you can check your user restrictions using the command below (apposite for "maximum user processes").

 $ 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) 256447 max locked memory (kbytes, -l) 64 max memory size (kbytes, -m) unlimited open files (-n) 128000 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) 500000 virtual memory (kbytes, -v) unlimited file locks (-x) unlimited 

If you want to increase the limit on the number of processes for a specific user (for example, hadoop), you need to make an entry in /etc/security/limits.conf below

 hadoop - nproc 500000 
+17
Apr 17 '14 at 18:07
source share

kernel.pid_max is a limiting factor, but at least equally important is kernel.threads-max. It is worth noting that, by default, nproc ulimit for each user has a kernel.threads-max value divided by two, and that each thread takes into account the nproc user restriction. Thus, "ps -u $ USER" may seem like the user has not exhausted his nproc limit, but "ps -L -u $ USER" can tell a completely different story.

+5
May 01 '14 at 19:57
source share



All Articles