• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 699
  • 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
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

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