From owner-freebsd-questions@FreeBSD.ORG Tue Jun 14 16:04:10 2005 Return-Path: X-Original-To: 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 58B3D16A41C for ; Tue, 14 Jun 2005 16:04:10 +0000 (GMT) (envelope-from tom.hurst@clara.net) Received: from spork.qfe3.net (spork.qfe3.net [212.13.207.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id 17AF643D4C for ; Tue, 14 Jun 2005 16:04:09 +0000 (GMT) (envelope-from tom.hurst@clara.net) Received: from [81.104.55.176] (helo=voi.aagh.net) by spork.qfe3.net with esmtp (Exim 4.50) id 1DiDtY-00006u-4l; Tue, 14 Jun 2005 17:04:08 +0100 Received: from freaky by voi.aagh.net with local (Exim 4.51 (FreeBSD)) id 1DiDtX-0002t9-MU; Tue, 14 Jun 2005 17:04:07 +0100 Date: Tue, 14 Jun 2005 17:04:07 +0100 From: Thomas Hurst To: David Banning Message-ID: <20050614160407.GA4819@voi.aagh.net> Mail-Followup-To: David Banning , questions@freebsd.org References: <20050611142103.GA77709@skytracker.ca> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050611142103.GA77709@skytracker.ca> Organization: Not much. User-Agent: Mutt/1.5.9i Sender: Thomas Hurst X-RBL-Warning: 81.104.55.176 is in RBL blacklist at dnsbl.sorbs.net Cc: questions@freebsd.org Subject: Re: httpd and memory usage 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: Tue, 14 Jun 2005 16:04:10 -0000 * David Banning (david+dated+1118931663.a557d5@skytracker.ca) wrote: > I seem to have a lot of memory being eaten by httpd (part output of top); > Any ideas to have httpd timeout sooner to preserve memory? MaxRequestsPerChild is there to cope with leaks, it won't help if Apache is using a lot of memory to start with though, but if you've got some mod_php or mod_perl which leaks it can be handy. Worker MPM uses threads and will probably share more memory than prefork, not to mention require you to use fewer processes to handle a given load. Moving things like mod_php and mod_perl stuff to FastCGI avoids each httpd having a copy of the interpreter and its various data structures each, and segments the memory of the interpreters outside httpd so it's easier to see what's using the memory; you'll have fewer copies running too, since the static:dynamic request ratio isn't normally 1:1. Commenting out unused modules in httpd.conf will save some memory. You might also consider switching to something like lighttpd, which uses a single process that's generally about 1/3 the size of an equivilent httpd process. -- Thomas 'Freaky' Hurst http://hur.st/