From owner-freebsd-questions Fri Jan 24 10:45:15 2003 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 551E737B401 for ; Fri, 24 Jan 2003 10:45:13 -0800 (PST) Received: from kientzle.com (h-66-166-149-50.SNVACAID.covad.net [66.166.149.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id BD6B243E4A for ; Fri, 24 Jan 2003 10:45:12 -0800 (PST) (envelope-from kientzle@acm.org) Received: from acm.org (UGLY.x.kientzle.comg [66.166.149.51] (may be forged)) by kientzle.com (8.11.3/8.11.3) with ESMTP id h0OIixR06209; Fri, 24 Jan 2003 10:45:00 -0800 (PST) (envelope-from kientzle@acm.org) Message-ID: <3E3189A8.3040102@acm.org> Date: Fri, 24 Jan 2003 10:44:56 -0800 From: Tim Kientzle Reply-To: kientzle@acm.org User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:0.9.6) Gecko/20011206 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Josh Brooks Cc: Varshavchick Alexander , freebsd-questions@FreeBSD.ORG Subject: Re: differentiating apache children from parents ? References: <20030124053226.U64423-100000@mail.econolodgetulsa.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Josh Brooks wrote: > I want to kill apache children that exceed a certain memory size - but I > want to make sure only to kill children. If you're having memory problems with Apache, this is not the way to solve it. Rather, limit the number of children using 'MaxClients' or 'ServerLimit'. That will restrict your total memory usage. (Note that restricting the number of children can considerably improve overall performance, especially if it prevents the system from swapping.) There's also a setting that limits the total number of requests handled by a particular child before that child exits on its own. That can be useful for limiting the damage from memory leaks, for example. Using some of the newer MPMs, it's also possible to designate certain children to process memory-hungry requests and manage overall memory usage that way. Probably the most important point, though, is to carefully evaluate your design choices. mod_perl, for instance, is a notorious memory pig. (It's possible to limit memory usage with mod_perl, but it requires a great deal of care.) Trying to kill children is just a bad idea. In particular, there's no way to ensure that you kill a child between requests, so you're gauranteed to lose some requests if you go this way (and quite possibly hang a few TCP connections along the way). Don't do it. Tim Kientzle To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message