I've fundamental understanding of running PHP in various designs like mod_php, cgi, FastCGI, etc.

During my findings and test I discovered FastCGI is slightly better. I love FastCGI's support for SuEXEC most. Wait I don't want to get involved with benchmarking business here again. Should you surf web, you will discover people showing one of the ways is faster than another when it comes to quantity of demands handled per second. Well its good metrics however i am thinking about different facets and listed here are my questions...

  1. Which approach to running PHP consumes less memory?
  2. Also which method consumes memory nearly constant. I see with mod_php my servers memory usage changing between 300MB and 800MB, every couple of seconds.
  3. However with FastCGI, first response from server comes very late. with FastCGI there's a preliminary delay per web page request. Once first response from server arrives, other products like images, css, js loads pretty faster.
  4. Could it be OK to operate mixture of both? I've 5 sites on devoted server. Could it be ok basically run couple of with mod_php and relaxation with FastCGI?
  5. I am certain that my server goes lower mostly due to improper memory usage by mod_php. I checked all scripts. Can there be in whatever way to make certain memory consumption on server remains nearly constant?
  6. Does complexity of .htaccess affects memory usage considerably? If so, will it be considered a single reason to create server exhaust memory?
  7. Does apache MPM prefork/worker configurations affect memory consumption? Will they affect mod_php and FastCGI mode equally?
  8. After I run "top" command, apache (httpd) consuming memory around 40MB. You will find most all cases of httpd running. Also additionally to that particular FastCGI forks some processes of comparable size. What's normal memory size for httpd process?
  9. Like me running Wordpress on our sites, which is good means by that context?
  10. Does FastCGI/SuExec works fine with APC? Should i reconfigure APC to utilize SuEXEC and FastCGI.

Please be aware, I'm less thinking about making it through against DIGG or traffic spikes. I would like a means that make server stable and foreseeable.

Sorry should i be confusing however i am really in mess. I've 512MB physical RAM, 400MB Swap and my server is drained of memory constantly. Average memory requirement is about 350MB, it simply memory usage spikes makes memory not available for couple of seconds and when couple of extra hits received in individuals couple of second window, apache crashed while mysql and all sorts of other fellas keep running fine.

Please assist me men. I'm not gonna buy more RAM or hardware. I'm damn certain issue is during my configuration. Sorry basically seem arrogant or ignorant.