My server will be hosting numerous PHP web applications ranging from Joomla, Drupal, and some legacy (read: PHP4) and other custom-built code inherited from clients. This will be a development machine used by a dozen or so web developers and issues like fluctuating loads or particularly high load expectations are not important.

Now, my question: are there any concerns I should know about when using Apache w/ MPM Worker, PHP 4/PHP 5.2/PHP 5.3 (all via FastCGI), and MySQL 5 (with a query cache of 64MB)?

I have not tested the various applications extensively and I have only recently learned how to install PHP and utilize it via FastCGI (rather than mod_php, which in this case seemed impossible (considering the multiple versions of PHP and the desire to use MPM Worker over MPM Prefork)).

I have come to understand that there could be concerns regarding XCache and APC, namely non-thread-safety issues where data becomes corrupted and the capability to use MPM Worker becomes null and void. Is this a valid concern?

I have been using my personal testing server (running Ubuntu Server Edition 10.04 in VirtualBox) which has 2GB of RAM available to it.

Here is the configuration used (the actual server will likely use a configuration more tailored to suit it's purposes):


Server version: Apache/2.2.14 (Ubuntu)
Server built:   Apr 13 2010 20:22:19
Server's Module Magic Number: 20051115:23
Server loaded:  APR 1.3.8, APR-Util 1.3.9
Compiled using: APR 1.3.8, APR-Util 1.3.9
Architecture:   64-bit
Server MPM:     Worker
    threaded:     yes (fixed thread count)
        forked:     yes (variable process count)


<IfModule mpm_worker_module>
    StartServers          2
    MinSpareThreads      25
    MaxSpareThreads      75
    ThreadLimit          64
    ThreadsPerChild      25
    MaxClients          400
    MaxRequestsPerChild 2000

PHP ./configure (PHP 4.4.9, PHP 5.2.13, PHP 5.3.2):

--enable-bcmath \
--enable-calendar \
--enable-exif \
--enable-ftp \
--enable-mbstring \
--enable-pcntl \
--enable-soap \
--enable-sockets \
--enable-sqlite-utf8 \
--enable-wddx \
--enable-zip \
--enable-fastcgi \
--with-zlib \
--with-gettext \

Apache php-fastcgi-setup.conf

FastCgiServer /var/www/cgi-bin/php-cgi-5.3.2
FastCgiServer /var/www/cgi-bin/php-cgi-5.2.13
FastCgiServer /var/www/cgi-bin/php-cgi-4.4.9

ScriptAlias /cgi-bin-php/ /var/www/cgi-bin/

2 Answers 2


The only thing you should ask yourself is: Are you really expecting so much traffic on your site to warrant such a complicated and risky setup (as opposed to "regular" prefork + php as a module).

I've been running a couple of php heavy sites peaking at 10m+ hits/day without having the need to switch to threaded model. PHP per se is a mess, making it jump through hoops is asking for it.

  • exactly, you need to see the traffic first. then with a few test, you can easly decide to use apache filter php or fcgi php. no one can comment as one is better than the other without analyzing your traffic & websites' structures. there are many conditions for efficiency. eg. cache and deflate usage, image or video file sizes, javascript or css conditions, bot traffic, keepalive timeout duration all are more important than php script's response time difference between different installations.
    – risyasin
    May 22, 2010 at 21:23

I can't agree with the answers above. It has nothing to do with how much traffic you expect but how much traffic someone can create. Unless you enjoy having a service that any miscreant can shut down at their whim, you have to design it to tolerate more load than the average miscreant can create.

  • Your 100% correct, and everyone would be best served, if distributions configured MPM-Worker and Fastcgi PHP out of the box. Apr 5, 2013 at 15:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.