Mailinglist Archive: opensuse (3767 mails)

< Previous Next >
Re: [SLE] maximum nproc value
  • From: Steve Graegert <graegerts@xxxxxxxxx>
  • Date: Mon, 6 Feb 2006 07:45:02 +0100
  • Message-id: <6a00c8d50602052245y4fc93693kc792706edfda97ad@xxxxxxxxxxxxxx>
On 2/3/06, Per Jessen <per@xxxxxxxxxxxx> wrote:
> Steve Graegert wrote:
>
> >> I just ran the above via a remote konsole, and my 2-way machine
> >> certainly _appears_ to be locked up. I'll have to make my way to the
> >> computer-room to check out the local console.
> >
> > Sorry, to hear that. I've used this code for years in trainings on a
> > couple of platforms. Never tried that on an Intel box running Linux
> > prior to 2.6. Can hardly believe that 2.4 can be compromised that
> > easily :-
>
> What's interesting is - it reported CHILD_MAX = 999, yet your bit of
> code was allowed to start 7000+ processes? (see my other posting)

As stated earlier, the return value of _SC_CHILD_MAX is a
recommendation for software developers, since there is no portable way
to obtain the maximum number of processes per real user id. It is a
reasonable maximum for applications running on Linux (or other
POSIX-compliant) systems and not a hard limit or something.

> This is not an area I've ever looked into - do I need to enable
> something or other in order to have a cap on the number of processes?

Yes, edit /etc/security/limits.conf and add the following line:

# <domain> <limittype> <item> <value>
<username> U hard 128

with username as a group, username or wildcard. This will prevent
<username> to create more than 128 processes. Be aware that some
environments (KDE, Gnome) can exceed this limit quite easily.

\Steve

--

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

< Previous Next >
Follow Ups