红联Linux门户
Linux帮助

Linux系统中最多可有多少个进程同时存在

发布时间:2007-12-25 16:13:39来源:红联作者:cmbzipos
去某家公司面试,面试的问linux系统中同时可有多少个进程存在。我说不知道,应该有几千个吧
回来后找了些资料,不是很多,一篇文章说2.4版本可同时有四千多个(大概4092);
若采取别的技术,可达到3万多个
但是内核里好像没有提及可有多少个

请问高手,最新版本的linux系统中,同时存在的进程数最多有多少?如何计算的?

ailms给的较答案

应该是取决于最大的 pid 值吧

锟斤拷锟斤拷:
[bob@mail ~]$ cat /proc/sys/kernel/pid_max
32768
[bob@mail ~]$


默认是 32768 ,最大值不能超过 2^22 (4194304)

锟斤拷锟斤拷:
/proc/sys/kernel/pid_max
This file (new in Linux 2.5) specifies the value at which PIDs wrap around (i.e., the value in this file is one greater than the maximum PID). The default value for this file, 32768, results in the same range of PIDs as on earlier kernels. The value in this file can be set to any value up to 2^22 (PID_MAX_LIMIT, approximately 4 mil-lion).


ulimit只是看当前shell(会话的),不是整个系统的。
文章评论

共有 1 条评论

  1. suntuse 于 2007-12-25 17:07:58发表:

    受教了