Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 696
  • Last Modified:

Php as cgi binary vs. apache module

I've been having problems with my Linux box running a ton of concurrent php processes.  The load during peak hours is unbearable.  I've heard from others running my similar setup that have been able to handle the load quite well.

Our host has php installed as a cgi-binary, and I've read that you can get a performance boost if it's installed as an apache module.  Is this true?  I've read about the security risks, but right now I'm a lot more concerned about performance.  How much of an impact will installing php as an apache module have on performance?  Is there another workaround with it installed as a cgi binary?

Any help would be greatly appreciated.

0
Igiwwa
Asked:
Igiwwa
  • 4
  • 2
1 Solution
 
ahoffmannCommented:
as module you have a performance boost, but it is a security nightmare
as CGI you can have good security, but it's a performance nightmare
you have to make a decision ...
0
 
IgiwwaAuthor Commented:
How much of a performance boost?  

I'm running an ad server and all it runs is php and mysql, with tons of requests per minute.  The load average at peak time is 30+.  There are usually between 5-20 php processes running at any given time in top, each eating up close to 7% of the CPU.  Will it give enough of a boost to fix this problem, or will i have to look into new hardware?

Also, I've tried to install some php accelerators (caching), but most of them don't work if php is installed as a cgi.  Do I have any options here to speed up or cache php scripts when its working as a cgi?

0
 
ahoffmannCommented:
I'd give mod_php a try
AFAIK accelerators improve mod_php only

you also may try FASTcgi, but I'd guess that PHP goes mad with that too

0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
IgiwwaAuthor Commented:
I don't think our host is gonna go for mod_php.

I've read good things about FASTcgi and would probably be able to implement it, what do you mean by "PHP goes mad with that too".
0
 
ahoffmannCommented:
I don't expect a perfomance boost for php CGIs with FASTcgi
There was a nice test which compared all the methods (module, CGI, FastCGI, Zend accelerator) in the german iX magazin 03/2005,  PHP mainly looses everywhere ..
AFAIK this article is not online, but you may try http://www.heise.de/ix/
0
 
ahoffmannCommented:
glad to have helped you, somehow ...
Thanks.
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now