473,378 Members | 1,444 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

mod_php or fastcgi?

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
5 3516

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
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
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

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

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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: yarmfelder | last post by:
Hi all, I noticed that with Slackware they don't include mod_php in the latest distro. I also noticed some talk on the web that there was an insecurity issue with mod_php in a previous version...
4
by: Peter Otten | last post by:
Is there a way to limit both width and height of a canvas text item? My current workaround seems clumsy: import Tkinter as tk root = tk.Tk() canvas = tk.Canvas(root, width=400, height=200,...
7
by: Vincent Delporte | last post by:
Hello I'm interested in hearing reflections by seasoned web app developpers about the different ways to write PHP apps, and especially how they compare in terms of performance, whether it's the...
3
by: howa | last post by:
concurrent request to httpd might as high as 300 and each httpd need 12M of memory (currently using mod_php) so total memory needed might over 3GB so under this case, should i use fastcgi?...
0
by: howa | last post by:
which one you preferred for running a production, busy site? seems PHP site only tell you to use mod_php, but seems fastcgi is a better choice for busy site (such as Yahoo also use fastcgi)
1
by: BMK | last post by:
I am using apache web server with php5 and oracle 10 as database server. in this scenerio, do I expect to have mod_php.so?
2
by: Evil Son | last post by:
Hello group, If I switched from mod_php to fast-cgi, would I need to make any changes to my php source? Also, will something like APC still be useful? Will my database connections suddenly...
4
by: setesting001 | last post by:
How many of you are running Fast CGI instead of the popular mod_php? I planning to change to fast cgi since my applications need around 15MB memory to handle a single request, so consider if...
7
by: yawnmoth | last post by:
Correct me if I'm wrong, but isn't running PHP via mod_php faster than running it via CGI? If so, why would a web hosting company be running PHP via CGI and not mod_php? I asked that very...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.