httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nilesh Govindarajan <li...@itech7.com>
Subject Re: [users@httpd] recommended setup apache/php
Date Mon, 26 Jul 2010 09:07:12 GMT
On Mon, Jul 26, 2010 at 1:26 PM, Hajo Locke <hajo.locke@gmx.de> wrote:
> Hello List,
>
> iam looking for most recommendend setup of apache/php for my purposes. I
> want to provide dynamical webspace for some users and there moderate volume
> pages.
> I know apache in combination with mod_php is fastest setup but i want to
> avoid mod_php for some reasons.
> Could imagine a setup like this: php is provided as fastcgi using mod_fcgid
> or mod_fastcgi (different versions possible) . Which threading model should
> apache use? worker or prefork?
> some pages recommend worker-threading for faster requests.
> Whats the opinion of the experts? which kind of setup is most recommend for
> my purposes? some people telled that php in cgi mode consumes a lot more cpu
> then mod_php. is that correct? how to avoid this?
>
> Thanks,
> Hajo
>

PHP in CGI mode consumes lot of memory because, for every request a
PHP interpreter is called up, so your memory is filled with N php
interpreters executing the same PHP code where N is the number of
online users.
There is no way to avoid it except using some different method like
fastcgi/mod_php.

FastCgi (also fcgid, its the same thing) is better as compared to
mod_php, because it gives more security i.e. the PHP interpreter is
not embedded into apache, php interpreter runs separately.
The PHP interpreter once started isn't killed by mod_{fastcgi,fcgid}
on the end of request as in CGI, but that is configurable.
Once a request finishes, the PHP interpreter keeps running, and as
soon as another request is received, the running PHP interpreter is
used to process the PHP file.
So there's no overhead of initiating the process again and again.
Also, mod_fcgid (not mod_fastcgi) caches the compiled code in memory,
so you don't need opcode caching mechanisms to accelerate PHP
performance like (eaccelerator, xcache, etc.) - reduces the memory
used by those extensions.

I personally use mod_fcgid on my server and am happy with it. It gives
stunning performance.

You should try out mod_fcgid.

-- 
Regards,
Nilesh Govindarajan
Facebook: http://www.facebook.com/nilesh.gr
Twitter: http://twitter.com/nileshgr
Website: http://www.itech7.com
VPS Hosting: http://www.itech7.com/a/vps

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message