On Dec 13, Roger Espel Llima wrote:
> So, does anyone know what PHP does? Does it parse the mixture of
> PHP and HTML every time? Does it keep a cache? Does it limit the
> size of this cache (which Apache::Registry doesn't)?. How big does
> a typical Apache/PHP process get?
both php3 and php4 reparse every file, out of the box.
php3 parses and executes simultaneously, php4 is more like perl
and has a two-step compile-and-execute.
the php4 runtime is designed to allow plugins to do caching of
compiled scripts. bwcache (http://bwcache.bware.it/) is one such
plugin, and zend cache (http://www.zend.com/zend/products.php#cache)
is another that is supposed to be released soon.
i don't know about a 'typical' apache/php process, but the httpd
processes on www.php.net run at around seven megs (vsz -- rss
is around 3-5 megs). but that's a totally meaningless number, of
course, since it doesn't take into account any shared pages across
those processes.
(for what its worth, www.php.net runs on a dual p3/650 with 512M
of ram and does about four million page views and 300 gigs of
raw traffic a month. i would consider that an atypical setup --
most users of php are the people who host at the scads of shared
hosting companies that offer php support.)
for comparisons of php and mod_perl, i would focus on the things
you can do in mod_perl that you simply can't in perl (handlers for
phases other than content-handling, for example). mod_perl gives
you a lot more rope to do cool things and to hang yourself with.
(the former is why most of us are here, the latter is why there
aren't scads of shared hosting companies that offer mod_perl.)
jim