Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 07 Dec 2005 15:08:12 +0000
From:      Alex Zbyslaw <xfb52@dial.pipex.com>
To:        Olaf Greve <o.greve@axis.nl>
Cc:        Polson Driessen <p.driessen@axis.nl>, freebsd-questions@freebsd.org
Subject:   Re: Memory limit issue (malloc) for PHP script under Apache
Message-ID:  <4396FADC.1080205@dial.pipex.com>
In-Reply-To: <4396EF45.4090205@axis.nl>
References:  <4396EF45.4090205@axis.nl>

next in thread | previous in thread | raw e-mail | index | archive | help
Olaf Greve wrote:

> Hi all,
>
> A colleague of mine has run into a weird issue, for which we hope 
> someone knows a solution (or otherwise: if someone knows there's no 
> (easy) solution, that's also good to know.
>
> The issue: when running a script that will consume a large amount of 
> memory (under FreeBSD 5.2.1-release i386, with custom kernel, with 
> Apache 1.3.34_2, PHP 4.4.1 as mod_php4); Apache seems to deschedule 
> the script in question as soon as it starts to consume over more or 
> less 512MB of memory; the machine has 1GB of memory, and at the moment 
> of running the script the rest of the machine is pretty much idle.


It's probably a limit problem.


If you were running apache2 you'd have easy control over limits:

 From /usr/local/etc/rc.d/apache.sh

# apache2limits_args (str):   Default to "-e -C daemon"
#                             Arguments of pre-start limits run.

which, IIUC picks up limits from /etc/login.conf class daemon (which on 
5.4 seems to default to everything unlimited).

You could just try hacking your apache1 startup script and putting:

ulimit -m unlimited

somewhere at the start.

Type ulimit -a to see all the possibles or man sh.

You can put the ulimit -a in your start up script too just so you can 
see what the limits are when apache starts.


--Alex




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4396FADC.1080205>