[Tfug] FastCGI vs. mod_php

Ian McEwen ianmcorvidae at ianmcorvidae.net
Mon Dec 15 20:25:27 MST 2014


On Mon, Dec 15, 2014 at 08:09:32PM -0700, John Gruenenfelder wrote:
> On Dec 15, 2014 11:36 AM, "Keith Smith" <techlists at phpcoderusa.com> wrote:
> >
> >
> > Hi,
> >
> > Any thoughts on FastCGI being less resource intensive than mod_php?
>
> Hi Keith,
>
> I could be completely wrong about this... but I was always under the
> impression that using something like mod_php, mod_perl, etc. kept the
> system from starting a new interpreter for every request.
>
> Again, this isn't backed by exhaustive research or anything; it's just how
> I've always thought it worked (which probably means I'm way off).  :)
>

A proper fastcgi process manager does the same thing! The "fast" is in
fact exactly that: ensuring that it doesn't need to spawn new processes
and instead uses a persistent interpreter. Generally it's a running
daemon that the web server dispatches requests to.

My favorite PHP deployment nowadays is nginx in front with php-fpm
(fastcgi process manager) behind it. Since nginx is based on an event
system rather than being preforking, it's a lot better at dealing with
lots of connections. And since the PHP interpreter isn't integrated with
the web server and you can configure exactly which paths go to it, it's
more secure -- no wackiness with malicious whatever.php.jpg files
getting interpreted as PHP code, as can happen with apache/mod_php.

I'm not sure if fastcgi is inherently less resource-intensive than
mod_php's approach, but passing fewer things to the interpreter
probably is, and nginx is *definitely* less resource-intensive than
apache is.

> --
> --John Gruenenfelder    Systems Manager, MKS Imaging Technology, LLC.
> Try Weasel Reader for PalmOS  --  http://weaselreader.org
> "This is the most fun I've had without being drenched in the blood
> of my enemies!"
>         --Sam of Sam & Max

> _______________________________________________
> Tucson Free Unix Group - tfug at tfug.org
> Subscription Options:
> http://www.tfug.org/mailman/listinfo/tfug_tfug.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://tfug.org/pipermail/tfug_tfug.org/attachments/20141215/582808c3/attachment.sig>


More information about the tfug mailing list