I'm trying to configure a server for a Wordpress site. What should I use for opcode caching? APC, xcache or eAccelerator?
-
Able to try any of the solutions? – JMeterX Aug 27 '12 at 16:33
4 Answers
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)
- 3,387
- 15
- 31
-
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 01 '12 at 02:19
-
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.
- 151
- 4
I would use apc on a nginx+php-fpm configuration. This is generally what we use for our site.
- 1,428
- 9
- 8
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.
- 203
- 2
- 7