Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

share|improve this question

closed as not constructive by Michael Hampton, mdpc, Khaled, dunxd, TheCleaner Mar 28 '13 at 17:51

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question.

    
Able to try any of the solutions? –  JMeterX Aug 27 '12 at 16:33

4 Answers 4

up vote 8 down vote accepted

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 APC System not using APC

share|improve this answer
    
Note 30M is ok for one Wordpress, if you host more site you have to multiply by the number of websites. Use apc.php to check memory usage. –  bokan Sep 1 '12 at 2:19
    
@bokan Good Point! –  JMeterX Sep 1 '12 at 3:13

I would use apc on a nginx+php-fpm configuration. This is generally what we use for our site.

share|improve this answer

I use APC at http://www.ubuntubrsc.com/ and it's pretty good.

If you mix that with Nginx (with microcache), PHP-FPM, Batcache and CloudFlare Pro, you get a really fast website. Resource usage is pretty awesome too.

share|improve this answer

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.

share|improve this answer

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