From owner-freebsd-questions@FreeBSD.ORG Fri Mar 26 14:24:57 2010 Return-Path: Delivered-To: questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 452E91065672 for ; Fri, 26 Mar 2010 14:24:57 +0000 (UTC) (envelope-from aimass@yabarana.com) Received: from qw-out-2122.google.com (qw-out-2122.google.com [74.125.92.26]) by mx1.freebsd.org (Postfix) with ESMTP id 0BBBD8FC1D for ; Fri, 26 Mar 2010 14:24:56 +0000 (UTC) Received: by qw-out-2122.google.com with SMTP id 5so2396731qwi.7 for ; Fri, 26 Mar 2010 07:24:56 -0700 (PDT) MIME-Version: 1.0 Sender: aimass@yabarana.com Received: by 10.229.98.138 with HTTP; Fri, 26 Mar 2010 06:59:29 -0700 (PDT) In-Reply-To: <201003261602378286864@ceopen.cn> References: <201003261602378286864@ceopen.cn> Date: Fri, 26 Mar 2010 09:29:29 -0430 X-Google-Sender-Auth: 16441278e6956b37 Received: by 10.229.14.157 with SMTP id g29mr1289076qca.57.1269611969821; Fri, 26 Mar 2010 06:59:29 -0700 (PDT) Message-ID: From: Alejandro Imass To: yuanxuqiang@ceopen.cn Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: questions Subject: Re: Install httpd.2.2.14 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: Fri, 26 Mar 2010 14:24:57 -0000 On Fri, Mar 26, 2010 at 3:32 AM, yuanxuqiang wrote: > Hello, > =A0 =A0 I use FreeBSD 7,and install httpd2.2.14; but > use MPM "prefork",perl cgi don't well run.when runing > cgi,would appear : > Internal Server Error > The server encountered an internal error or misconfiguration and was unab= le to complete your request. > apache's err_log : > Out of memory during request for , referer: http://www.la-bbs.com/ > [Fri Mar 26 15:12:38 2010] [error] [client 61.155.152.26] 28, referer: ht= tp://www.la-bbs.com/ > [Fri Mar 26 15:12:38 2010] [error] [client 61.155.152.26] =A0bytes, total= sbrk() is , referer: http://www.la-bbs.com/ > [Fri Mar 26 15:12:38 2010] [error] [client 61.155.152.26] 3166208, refere= r: http://www.la-bbs.com/ > [Fri Mar 26 15:12:38 2010] [error] [client 61.155.152.26] =A0bytes!, refe= rer: http://www.la-bbs.com/ > > =A0 =A0if use MPM "worker" ,cgi is normal runing. > why ? Now _that_ is very odd! People usually have more problems with worker! The diference between mod_prefork and mod_worker is that the latter is multi-process and multithreaded while the former is just multi-process. Now with you matter at hand, are you sure you are takling about CGI?, I mean are you positive that you are in fact forking the slave process as a separate program? That question is just out of curiosity because your problem reminds me of mod_perl problems with large application where it may make sense to run with worker... Yes, I know, people will tell you stay away from perl threads like the page, but in fact I have found situations where it makes perfect sense to use worker with mod_perl instead of prefork. In any case, from your log snip, it seems obviuos that Apache is running out of memory wher trying to fork. Maybe you have no swap in that machine? Please check with top and look at swap usage. On linux top shows a wa parameter which will hint that the cpu is waiting (%wa), on FBSD I _think_ you have to enable process accounting and use sa, but I'm just a noob in FBSD so perhaps others can ...[fill in here]..... Every OS has a virtual mem manager logic, (side note: I have found that vanilla FBSD is way more stable in vm mgmt than vanilla Linux 2.6 and not so freaking optimistic!). Anyway, check your mod_prefork section in the apache conf and make sure you are not trying to fork more processes than the memory you have available, this includes also complete copies of your cgi application. So figure out how much memory each apache process takes up (unload unnecessary modules, etc.) and add to each apache process the amount of memory your cgi app uses. Also, you should leave the OS with at least a couple of free megabytes of RAM, although as I stated earlier FBSDs vm mgmt is so awesome that you can really swap to the limit, but I wouldn' t recommend that anyway. If you are really planing on using plain'ol CGI you could recompile apache and make it very lean for your needs. If your app is too fat, maybe you try to move to fast-cgi, threaded or forked so you can keep as much code segments shared between the childs, or look into mod_perl and mod_morker, but be warned leakage is inevitable so you have to control the life of each process carefully (max req per child param). Hope this helps, Alejandro Imass > =A0 =A0 think you answer me. > > =A0 =A0 =A0 =A0 =A0 =A0best wishes! > > yuanxuqiang > 2010-02-26 > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.o= rg" >