From owner-freebsd-questions@FreeBSD.ORG Wed Dec 7 15:08:15 2005 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C492C16A41F for ; Wed, 7 Dec 2005 15:08:15 +0000 (GMT) (envelope-from xfb52@dial.pipex.com) Received: from smtp-out3.blueyonder.co.uk (smtp-out3.blueyonder.co.uk [195.188.213.6]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2F72C43D58 for ; Wed, 7 Dec 2005 15:08:14 +0000 (GMT) (envelope-from xfb52@dial.pipex.com) Received: from [80.192.2.225] ([80.192.2.225]) by smtp-out3.blueyonder.co.uk with Microsoft SMTPSVC(5.0.2195.6713); Wed, 7 Dec 2005 15:09:08 +0000 Message-ID: <4396FADC.1080205@dial.pipex.com> Date: Wed, 07 Dec 2005 15:08:12 +0000 From: Alex Zbyslaw User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-GB; rv:1.7.12) Gecko/20051106 X-Accept-Language: en MIME-Version: 1.0 To: Olaf Greve References: <4396EF45.4090205@axis.nl> In-Reply-To: <4396EF45.4090205@axis.nl> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 07 Dec 2005 15:09:08.0070 (UTC) FILETIME=[2BC47060:01C5FB40] Cc: Polson Driessen , freebsd-questions@freebsd.org Subject: Re: Memory limit issue (malloc) for PHP script under Apache X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Dec 2005 15:08:15 -0000 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