Mailinglist Archive: opensuse (3767 mails)

< Previous Next >
Re: [SLE] maximum nproc value
  • From: Steve Graegert <graegerts@xxxxxxxxx>
  • Date: Thu, 2 Feb 2006 16:28:33 +0100
  • Message-id: <6a00c8d50602020728l12fc1afds513e6aff42c18c93@xxxxxxxxxxxxxx>
On 2/2/06, Michael Green <mishagreen@xxxxxxxxx> wrote:
> On 2/2/06, Steve Graegert <graegerts@xxxxxxxxx> wrote:
>
>
> Wow, such a quick reply...
>
> gene1:~ # vi nproc.c
> gene1:~ # cc nproc.c -o nproc
> gene1:~ # ./nproc
> CHILD_MAX = 999
>
> that means that a user cannot fork more than 999 processes?
>
> Now suppose I run a fork bomb, the machine will die right away. Why?
> Cannot modern dual cpu computer handle a little more than 999
> processes?

That's quite a lot. A user should never, never need so many
processes. A mondern UNIX (and Linux) system can handle far more than
999 processes quite reliably. But consider a multi-user system with,
say, 50+ users, everyone of them creating around 1000 processes. It's
a nightmare.

A fork bomb eats up all the process table entries and, due to its
recursive calls to fork(), creates a huge amount of overhead that can
bring systems down. It's actually not the number of processes that
are difficult to handle but a fork bomb creates children of its
children of its children... which means that memory is eaten up and
even unwinding the stack afterwards to clean up is difficult.

Limits like the one you asked for help to prevent fork bombs.

\Steve

--

Steve Graegert <graegerts@xxxxxxxxx>
Software Consultant {C/C++ && Java && .NET}
Office: +49 9131 7123988
Mobile: +49 1520 9289212

< Previous Next >
Follow Ups