Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 16 Jan 2012 10:05:15 -0500
From:      Alejandro Imass <ait@p2ee.org>
To:        Daniel Lewis <innervisionnetwork@gmail.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: apache
Message-ID:  <CAHieY7S8FeddgUCajvcQOExDeV4VsgchppDt6Xw18gKYB-qrbg@mail.gmail.com>
In-Reply-To: <CAHsiZG_mbNF-2ezq9pEVv4vo4Fgdqs4PAdN0gPHYDu-zOmjnAA@mail.gmail.com>
References:  <CAHsiZG_mbNF-2ezq9pEVv4vo4Fgdqs4PAdN0gPHYDu-zOmjnAA@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Jan 16, 2012 at 7:03 AM, Daniel Lewis
<innervisionnetwork@gmail.com> 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAHieY7S8FeddgUCajvcQOExDeV4VsgchppDt6Xw18gKYB-qrbg>