By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,587 Members | 1,047 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,587 IT Pros & Developers. It's quick & easy.

mod_php or fastcgi?

P: n/a
hi,

which package you perfer?

mod_php on apache is okay but some people said fastcgi version of php
is faster, is it true?

thanks...

Jul 8 '06 #1
Share this Question
Share on Google+
5 Replies


P: n/a

Michael Vilain 寫道:
In article <11**********************@b28g2000cwb.googlegroups .com>,
ho******@gmail.com wrote:
hi,

which package you perfer?

mod_php on apache is okay but some people said fastcgi version of php
is faster, is it true?

thanks...

Depends. (That's the standard answer for ambiguous questions which don't
have sufficient technical details to provide an informed opinion).

Specifically, it depends on the environment (hardware and software)
you're running on. OS and version? Hardware platform--CPU, memory,
disk? Shared web server or dedicated? What sort of web application are
you running? How much traffic is it expected to handle currently? In 6
months? 1 year? 3 years?

It's my understanding that fastcgi forks a process for each connection,
running in the context of web server. mod_php runs as a thread, allowingfor
it to run concurrently with other processes on multi-CPU systems.

--
DeeDee, don't press that button! DeeDee! NO! Dee...
consider the followings...

OS - CentOS 4.3
CPU - Intel Pentium D Dual Core 2.8Ghz
Memory - 2GB DDR2
Dedicated Web server
Expect to handle around 500 connections, each requests use at most 3MB
of memory

Jul 8 '06 #2

P: n/a
ho******@gmail.com wrote:
>
which package you perfer?

mod_php on apache is okay but some people said fastcgi version of php
is faster, is it true?
It doesn't matter. The difference in speed between the two approaches is
dwarfed by the improvements you can get in caching and improving your
algorithms. Further, unless you intend for your web site to serve hundreds
of hits per second, the difference won't be noticeable.

Don't start micro-optimizing until you know that the simplest approach
doesn't meet the specs.
--
- Tim Roberts, ti**@probo.com
Providenza & Boekelheide, Inc.
Jul 8 '06 #3

P: n/a
Michael Vilain wrote:
It's my understanding that fastcgi forks a process for each connection,
running in the context of web server. mod_php runs as a thread, allowing for
it to run concurrently with other processes on multi-CPU systems.
Not quite. If it creates a process per connection then it wouldn't be
fast. FastCGI works sort of like a Java app server. It runs it a
separate process and communicates with the web server across a socket
connection. Since interprocess communication is very fast, FastCGI is
at least on-par with an in-process module in terms of performace. And
the decoupling of web-server from the app-server allows resources to be
better managed, so it could be actually be faster. For example,
persistent connections when used with mod_php is quite wasteful, since
every Apache process would own a connection to the database, even
though it might actually spend majority of the time serving image files.

Jul 9 '06 #4

P: n/a

Tim Roberts 寫道:
ho******@gmail.com wrote:

which package you perfer?

mod_php on apache is okay but some people said fastcgi version of php
is faster, is it true?

It doesn't matter. The difference in speed between the two approaches is
dwarfed by the improvements you can get in caching and improving your
algorithms. Further, unless you intend for your web site to serve hundreds
of hits per second, the difference won't be noticeable.

Don't start micro-optimizing until you know that the simplest approach
doesn't meet the specs.
in fact, security is also one of the concern. people said fastcgi
version is more secure, and reliable

Jul 9 '06 #5

P: n/a

Michael Vilain wrote:
In article <11**********************@m73g2000cwd.googlegroups .com>,
ho******@gmail.com wrote:
Michael Vilain F
In article <11**********************@b28g2000cwb.googlegroups .com>,
ho******@gmail.com wrote:
>
hi,

which package you perfer?

mod_php on apache is okay but some people said fastcgi version of php
is faster, is it true?

thanks...
>
Depends. (That's the standard answer for ambiguous questions which don't
have sufficient technical details to provide an informed opinion).
>
Specifically, it depends on the environment (hardware and software)
you're running on. OS and version? Hardware platform--CPU, memory,
disk? Shared web server or dedicated? What sort of web application are
you running? How much traffic is it expected to handle currently? In 6
months? 1 year? 3 years?
>
It's my understanding that fastcgi forks a process for each connection,
running in the context of web server. mod_php runs as a thread, allowing
for
it to run concurrently with other processes on multi-CPU systems.
>
--
DeeDee, don't press that button! DeeDee! NO! Dee...
consider the followings...

OS - CentOS 4.3
CPU - Intel Pentium D Dual Core 2.8Ghz
Memory - 2GB DDR2
Dedicated Web server
Expect to handle around 500 connections, each requests use at most 3MB
of memory

For security on my shared web host, I use CGI when I need to run a perl
script as a specific user. My ISP provides CGIwrap for this purpose.
Otherwise, I run all my site using mod_php. It can access the MySQL
database and display the pages and is fast enough.

Since you have a dual core system, I'd use mod_php. You'd be able to benefit
from it immediately with a threaded Apache server. And the site will
scale if you add more CPUs.

--
DeeDee, don't press that button! DeeDee! NO! Dee...
Theorectically, except PHP isn't thread safe, and requires you use the
pre-fork model of apache. This is suppose to change, eventually. Word
is mod_php is faster, by and large though, probably because its
integrated more with apache than a completely seperate cgi process.

Jul 9 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.