Re: mod_php vs fastcgi/php speed [BENCHMARK]
On Fri, 2004-03-19 at 06:42, Joris wrote:
> I'm looking for some in-depth information on the speed difference
> between mod_php and using php-cgi with fastcgi.
> So far a google search has yielded nothing but unbacked statements (I'll
> clean up the language a bit): "mod_php is a lot fast er than php-cgi",
> and "fastcgi/php is a lot faster than mod_php". Not very usefull.
> Anyone care to shed some light/benchmarks here?
hhmm you made me curious, and I started a benchmark, here the results:
(btw the server is a P3 1ghz, 512MB RAM, Debian Woody)
Summary of the benchmark
PHP4 module, very simple script (phpinfo.php): requests/s
PHP4 module, very complex script (insurance application): requests/s
PHP4 CGI, very simple script (phpinfo.php): requests/s
PHP4 CGI, very complex script (insurance application): requests/s
* = turkcache doesn't support caching of the PHP scripts in CGI mode
> Also, experiences migrating from mod_php to (fast)cgi/php would be
> welcome :)
migrating from mod to cgi is good as in security, but performance and
also problems with some scripts.
Those problems with scripts come from .htaccess files which try to
change things with "php_flag" (which is not possible with cgi).
Also sometimes script use variables like $_SERVER['SCRIPT_NAME'], they
get changed by cgi-handler apache things. They usually still work, but
its still different than before (with php_mod). E.g. with mod_php
SCRIPT_NAME is foo.php, with cgi its something like cgi-bin/php/foo.bar
If you use suPHP though (www.suphp.org), it will correct those $_SERVER
I hope this answered your questions
Mirco 'meebey' Bauer
-----BEGIN GEEK CODE BLOCK-----
GIT d s-: a--- C++ UL++>++++ P L++$>+++$ E W+++$ N o? K- w++>! O- M- V? PS
PE+ Y- PGP>++ t 5+ X++ R tv+ b+ DI? D+ G>++ e h! r>++ y?
------END GEEK CODE BLOCK------