Apache2Triad Help, Support and Development Forum Index Apache2Triad Help, Support and Development
The apache2triad help , support and development forums
 

php speed. mod php5 or cgi php?
Click here to go to the original topic

 
       Apache2Triad Help, Support and Development Forum Index -> Apache
View previous topic :: View next topic  
Author Message
DeliriumServers



Joined: 20 Feb 2006
Posts: 13
Location: H Town

Posted: Fri Mar 17, 2006 2:21 am    Post subject: php speed. mod php5 or cgi php?  

Which is faster php through mod php5? or through cgi? Based on the default install I would guess mod php5 is faster, but I just wanted to make sure, thanks.
Back to top  
Vlad Alexa Mancini



Joined: 07 Jul 2003
Posts: 1538

Posted: Sat Mar 18, 2006 4:15 pm    Post subject:  

thanks you for this question , i seldomly get to explain something on these forums that is not in a manual

Ok , apache has 2 mechanisms for providing access to a external compiler :
1 - Dynamic Shared Object (DSO) , a apache module for the compiler is loaded on apache startup
2 - Common Gateway Interface (CGI) , apache queries the compiler executable each time it is requested to

Unanimously DSO is the preferred way from two major considerations , performance and security.

First off , with CGI apache has to start a new instance of the compiler for each request , given some simultaneous requests the performance is highly impacted

Second off with CGI the compiler startup overhead is on a per-request basis , as opposed with only on apache startup in the case of DSO , which also impacts performance

Finally , CGI because of it's design has some major security implications especially on shared servers where scripts runned on the server do not come from a trusted source
Back to top  
DeliriumServers



Joined: 20 Feb 2006
Posts: 13
Location: H Town

Posted: Sun Mar 19, 2006 3:15 am    Post subject: thanks  

thanks, I really appreciate getting a clear reply, especially from the devoloper of the app suite. Thanks! mod_php will continue to speed along on my server :D
Back to top  
 
       Apache2Triad Help, Support and Development Forum Index -> Apache
Page 1 of 1


Powered by phpBB Search Engine Indexer
Powered by phpBB 2.0.13 © 2001, 2002 phpBB Group