On Wed, Sep 8, 2010 at 3:06 PM, Jordan Schatz <[email protected]> wrote:
> I am looking for an authoritative answer to which is faster, mod_fastCGI
> or mod_php? as with most performance questions everyone seems to have a
> different answer (when I googled it)... As I understand it, for Apache to
> handle an additional request with mod_php it has to create a child thread
> with the entire Apache and mod_php environment, so there is alot of
> overhead, whereas with fastCGI Apache can make an additional request to
> the existing fastCGI connection, thereby saving the overhead. But isn't
> it a limitation of Apache that it cant send multiple requests through a
> single connection? So wouldn't it be creating an additional apache child +
> mod_fastCGI which then calls PHP for each connection? Anyway I'm not
> seeing the performance gain, but don't know if I have things setup right.

Speaking strictly from the PHP point of view, these are likely to be
so close as to be a wash.  There are other potential benefits of going
the fastcgi route, but they have less to do with PHP specifically and
more to do with your setup.  For instance if you are serving static
and dynamic content from the same server then shifting dynamic work
out via fastcgi allows the web server to be lighter weight.  Once
you've reached that point you can also consider other web servers,
like nginx.

> What would be a good way to increase performance of a large number of
> simultaneous requests, all requesting small amounts of dynamically
> generated content? (think lots of AJAX : )

Hard to say in a general way other than to suggest that the less work
involved the better things usually perform.  If you can, skip PHP
entirely and serve it as static content.  If you need to do processing
on the requests analyze exactly what is either a) taking the most time
or b) is the easiest to improve and work on optimizing those.


Shameless self promotion - I'll be presenting 'Anatomy of a PHP
Request' at UTOSC this year - http://utosc.com/presentation/289/ which
will cover a number of the tools available for looking what goes on
during a PHP request.

-- 
Joseph Scott
[email protected]
http://josephscott.org/

_______________________________________________

UPHPU mailing list
[email protected]
http://uphpu.org/mailman/listinfo/uphpu
IRC: #uphpu on irc.freenode.net

Reply via email to