Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 19 Mar 2005 09:16:22 -0500
From:      Chuck Swiger <cswiger@mac.com>
To:        "Ryan J. Cavicchioni" <ryan@confabulator.net>
Cc:        FreeBSD Questions <freebsd-questions@freebsd.org>
Subject:   Re: How to avoid forkbomb?
Message-ID:  <423C3436.2030501@mac.com>
In-Reply-To: <423B8314.1000606@confabulator.net>
References:  <423B8314.1000606@confabulator.net>

next in thread | previous in thread | raw e-mail | index | archive | help
Ryan J. Cavicchioni wrote:
> Am I looking at the correct values?

Yes.

> Which is the actual process limit?

The lower number, 3632, is the max processes permitted per user.

> What would you recommend that I set it to in order to have my machine 
> shrug off the fork bomb sooner?

Probably around 300.

> What would be a good process limit for a LAMP webserver?

The # of Apache children you want to run + 50 or so...

> How would I set the process limits?

You could change login.conf (be sure to run "cap_mkdb /etc/login.conf"), or 
you could change the limits seen all processes by changing /etc/profile, or 
for specific user accounts by changing that user's startup scripts:

# Set reasonable soft process limits.
ulimit -Sc 100000
ulimit -Sd 512000
ulimit -Ss 65536
ulimit -Sn 512
ulimit -Su 256

-- 
-Chuck



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?423C3436.2030501>