From owner-freebsd-questions@FreeBSD.ORG Mon Jan 16 15:05:17 2012 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1E44B106566C for ; Mon, 16 Jan 2012 15:05:17 +0000 (UTC) (envelope-from aimass@yabarana.com) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id E51A18FC1C for ; Mon, 16 Jan 2012 15:05:15 +0000 (UTC) Received: by iagz16 with SMTP id z16so5686074iag.13 for ; Mon, 16 Jan 2012 07:05:15 -0800 (PST) MIME-Version: 1.0 Received: by 10.42.147.72 with SMTP id m8mr10630949icv.56.1326726315539; Mon, 16 Jan 2012 07:05:15 -0800 (PST) Sender: aimass@yabarana.com Received: by 10.231.77.5 with HTTP; Mon, 16 Jan 2012 07:05:15 -0800 (PST) In-Reply-To: References: Date: Mon, 16 Jan 2012 10:05:15 -0500 X-Google-Sender-Auth: XzvimdmyzorG6hoDmHa1C80kyvo Message-ID: From: Alejandro Imass To: Daniel Lewis Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-questions@freebsd.org Subject: Re: 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: Mon, 16 Jan 2012 15:05:17 -0000 On Mon, Jan 16, 2012 at 7:03 AM, Daniel Lewis wrote: > Hey I install apache on free bsd 8.2 but accidentially didnt include > the perl threads. Now when I try to re-install it says perl file > required for apache......How do i fix this problem? > I am assuming you want to run mod_perl on mod_worker so here are my 0.02: To answer your question you must build, and/or re-build Perl first and then Apache and then mod_perl in that order. You can do this as many times as you like because I've done it personally _many_ times. You must of course make desinstall before you can make install again. I've used mod_worker/mod_perl and it's probably _awesome_ for _some_ situations but it's not as straight forward as you may think, and it's not worth the hassle unless you really, really need it to take advantage of idle CPU with the same amount of RAM. You can definitively increase your Apache processes by ten fold _easily_ (and perhaps a lot more) using marginally more RAM, but you must have the CPU power to back it up or you will choke real quickly. You must have very clear, your average response per request to be able to project the actual concurrency, and you must leave _at least_ 1-2GB of RAM free for the OS and calculate at least 20% free time for CPUs. For one, not all Perl code is thread-safe and you must really understand how mod_perl shares the non-mutable segments and all that. This doesn't necessarily mean you can't use _all_ non thread-safe code, but you have to know which parts are fragile, and exactly how fragile they are. Remember mod_perl already loads your PMs globally so you are already saving a lot of memory there (not like mod_php which is basically a fancy SSI-type lang). The only reason to use mult-threaded LWP is to spawn many more Apache threads with mod_worker assuming that your RAM is actually big enough and you a lot of idling CPU power you want to take advantage of. The growth of the memory usage will becoem a trial and error thing and you must reset your main processes with maxrequestsperchild directive once in a while because most thread implementations including FBSD's will leak over time. Anyway, it's MHO but if you really don't understand exactly why and how you're going to use mod_worker/mod_perl just stick to mod_prefork and you'll still get *a very decent* performance and use of your HW. When I started using mod_perl/mod_worker it was quite experimental but if you sit down and do your homework it will really work wonders to squeeze the last drop on your HW. Also, be grateful you're using FBSD for such things, 'cause it can take the beating. This is one area where FBSD leaves Linux in the dust ;-) Cheers, -- Alejandro Imass