2001-10-18 18:43:21

by Gregory Ade

[permalink] [raw]
Subject: 2.2.x process limits (NR_TASKS)?

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

We're running into what appears to be a 256-process-per-user limit on one
of our webservers, due to the number of processes running as a specific
user for our application. I'd like to increase the process limit, and
*THINK* that to do so i need to increase NR_TASKS in
/usr/src/linux/include/linux/tasks.h.

Is this correct? What other things do I need to watch out for when making
this modification?

Also, where can this limit be changed in 2.4.x?

Thanks ahead of time.

- --
Gregory K. Ade <[email protected]>
http://unnerving.org/~gkade
OpenPGP Key ID: EAF4844B keyserver: pgpkeys.mit.edu
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE7zyKJeQUEYOr0hEsRAp6PAJ4lkIEGskwko9xrbhJuiU1kyhdLTgCgryc9
UnP+9CzAwfM9nIgluW36yLY=
=xuPV
-----END PGP SIGNATURE-----



2001-10-18 19:05:01

by Brian Gerst

[permalink] [raw]
Subject: Re: 2.2.x process limits (NR_TASKS)?

Gregory Ade wrote:
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> We're running into what appears to be a 256-process-per-user limit on one
> of our webservers, due to the number of processes running as a specific
> user for our application. I'd like to increase the process limit, and
> *THINK* that to do so i need to increase NR_TASKS in
> /usr/src/linux/include/linux/tasks.h.
>
> Is this correct? What other things do I need to watch out for when making
> this modification?
>
> Also, where can this limit be changed in 2.4.x?
>
> Thanks ahead of time.
>

2.2.x has a hard limit of 512 tasks on the x86 because it uses hardware
task switching. 2.4.x allows an unlimited number of tasks, and is
configurable via /proc/sys/kernel/threads-max and ulimit.

--

Brian Gerst

2001-10-18 19:13:11

by Mark Zealey

[permalink] [raw]
Subject: Re: 2.2.x process limits (NR_TASKS)?

On Thu, Oct 18, 2001 at 03:04:53PM -0400, Brian Gerst wrote:

> Gregory Ade wrote:
> >
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA1
> >
> > We're running into what appears to be a 256-process-per-user limit on one
> > of our webservers, due to the number of processes running as a specific
> > user for our application. I'd like to increase the process limit, and
> > *THINK* that to do so i need to increase NR_TASKS in
> > /usr/src/linux/include/linux/tasks.h.
> >
> > Is this correct? What other things do I need to watch out for when making
> > this modification?
> >
> > Also, where can this limit be changed in 2.4.x?
> >
> > Thanks ahead of time.
> >
>
> 2.2.x has a hard limit of 512 tasks on the x86 because it uses hardware
> task switching. 2.4.x allows an unlimited number of tasks, and is
> configurable via /proc/sys/kernel/threads-max and ulimit.

eh? why? The GDT can hold up to 2 ** 16 bytes (limit is 16-bit). Each entry is 8
bytes, that means that there are 8192 possible 'slots' in the GDT. Each process
has 2 entries, an LDT and a task struct entry. Why is the limit 512? couldn't it
be about 4000? (Some entries are needed for APM and other things...)

--

Mark Zealey (aka JALH on irc.openprojects.net: #zealos and many more)
[email protected]
[email protected]

UL++++>$ G!>(GCM/GCS/GS/GM) dpu? s:-@ a16! C++++>$ P++++>+++++$ L+++>+++++$
!E---? W+++>$ N- !o? !w--- O? !M? !V? !PS !PE--@ PGP+? r++ !t---?@ !X---?
!R- b+ !tv b+ DI+ D+? G+++ e>+++++ !h++* r!-- y--

(http://www.geekcode.com)

2001-10-18 19:29:41

by Miquel van Smoorenburg

[permalink] [raw]
Subject: Re: 2.2.x process limits (NR_TASKS)?

In article <[email protected]>,
Gregory Ade <[email protected]> wrote:
>We're running into what appears to be a 256-process-per-user limit on one
>of our webservers, due to the number of processes running as a specific
>user for our application. I'd like to increase the process limit, and
>*THINK* that to do so i need to increase NR_TASKS in
>/usr/src/linux/include/linux/tasks.h.

--- linux-2.2.19.orig/include/linux/tasks.h Mon Dec 11 01:49:44 2000
+++ linux-2.2.19/include/linux/tasks.h Thu Mar 29 13:08:16 2001
@@ -11,7 +11,7 @@
#define NR_CPUS 1
#endif

-#define NR_TASKS 512 /* On x86 Max about 4000 */
+#define NR_TASKS 2048 /* On x86 Max about 4000 */

#define MAX_TASKS_PER_USER (NR_TASKS/2)
#define MIN_TASKS_LEFT_FOR_ROOT 4

>Also, where can this limit be changed in 2.4.x?

/proc/sys/kernel/threads-max

Mike.
--
"Only two things are infinite, the universe and human stupidity,
and I'm not sure about the former" -- Albert Einstein.

2001-10-18 19:40:21

by Brian Gerst

[permalink] [raw]
Subject: Re: 2.2.x process limits (NR_TASKS)?

Mark Zealey wrote:
>
> On Thu, Oct 18, 2001 at 03:04:53PM -0400, Brian Gerst wrote:
>
> > Gregory Ade wrote:
> > >
> > > -----BEGIN PGP SIGNED MESSAGE-----
> > > Hash: SHA1
> > >
> > > We're running into what appears to be a 256-process-per-user limit on one
> > > of our webservers, due to the number of processes running as a specific
> > > user for our application. I'd like to increase the process limit, and
> > > *THINK* that to do so i need to increase NR_TASKS in
> > > /usr/src/linux/include/linux/tasks.h.
> > >
> > > Is this correct? What other things do I need to watch out for when making
> > > this modification?
> > >
> > > Also, where can this limit be changed in 2.4.x?
> > >
> > > Thanks ahead of time.
> > >
> >
> > 2.2.x has a hard limit of 512 tasks on the x86 because it uses hardware
> > task switching. 2.4.x allows an unlimited number of tasks, and is
> > configurable via /proc/sys/kernel/threads-max and ulimit.
>
> eh? why? The GDT can hold up to 2 ** 16 bytes (limit is 16-bit). Each entry is 8
> bytes, that means that there are 8192 possible 'slots' in the GDT. Each process
> has 2 entries, an LDT and a task struct entry. Why is the limit 512? couldn't it
> be about 4000? (Some entries are needed for APM and other things...)

Ok, maybe not so hard. It is kept at 512 to keep the GDT from eating up
too much memory. Increasing it will work just fine, as long as you
don't hit the GDT limit. 2.4.x uses per-cpu GDT entries instead of
per-task, allowing threads-max to be dynamically configurable.

--

Brian Gerst

2001-10-21 15:35:58

by Alan

[permalink] [raw]
Subject: Re: 2.2.x process limits (NR_TASKS)?

> 2.2.x has a hard limit of 512 tasks on the x86 because it uses hardware

About 3800 actually - the default compile value can be upped