Apc, xcache or eAccelerator? What should I use for Wordpress? [closed]

I'm trying to configure a server for a Wordpress site. What should I use for opcode caching? APC, xcache or eAccelerator?


Solution 1:

APC is by far the best option out of the three. eAccelerator is beginning to lose its foundation and seems to have issues with the latest version of PHP. APC can be found here. There are a lot of other links out there but this is a reputable one (assuming that's the latest version). The main settings to define in your php.ini file will be:

extension=”apc.so”
apc.enabled=”1”
apc.shm_size=”30M”

As an example I ran a Piwik installation load balanced over three servers and with eAccelerator and it was able to handle about 15 hits per second. Once I switched to APC and narrowed down the settings I needed for my installation we were achieving over 40 hits per second (more than 2 million hits per month) without any flaws in the Piwik web interface.

Here is an image of our CPU with APC on & off (Piwik uses a cron job to gather its information, but the point is its effectiveness)

System using APCSystem not using APC

Solution 2:

I would give a hard look at Xcache currently. APC hasn't had many updates and produces quite a few opcode errors for us. Xcache is also maintained by the lighttpd group which shouldn't need much of an introduction.

Finally, APC isn't integrated and won't be integrated within PHP for all those saying so (not necessarily in this thread but all across the net. That was true for initial PHP6 talks which got back-ported to 5.4, but was dropped). The latest talks have PHP trying to determine what opcode caching system to use, if any. Last I heard, Zend Accelerator was being considered, which you can't even download directly anymore.