apc vs eaccelerator vs xcache
Asked Answered
A

12

105

Im doing research on which one of these to use and I can't really find one that stands out. Eaccelerator is faster than APC, but APC is better maintained. Xcache is faster but the others have easier syntax.

Anyone have recommendations on which to use and why?

Ashcroft answered 30/5, 2009 at 23:43 Comment(3)
eAccelerator doesn't look like it has seen a release in over a year. xcache's VC is certainly active, but I couldn't focus out releases and a focus either. It all boils down to a piece of software that is being maintained and APC wins it hands down.Wenonawenonah
It is Q3 2011. Did things changed since 2009?Endogen
Also https://mcmap.net/q/152999/-which-php-opcode-cacher-should-i-use-to-improve-performance-closed/632951Kahlil
H
110

APC is going to be included in PHP 6, and I'd guess it has been chosen for good reason :)

It's fairly easy to install and certainly speeds things up.

Hematite answered 31/5, 2009 at 0:28 Comment(11)
I've been weighing up these three and have decided to start testing with APC for this reason. The other two seem to have some stability issues too.Peanuts
I've seen stability issues with all of them, but settled for APC and any problems we've had with it we've been able to resolve.Rhombencephalon
I've only run into three issues with APC, all of which were things under my control. 1) Don't let APC fill up. Make sure to allocate enough memory 2) Don't use apc_clear_cache() on an active server 3) APC doesn't really cope well with heavy lock contention -- don't try to write to a single key from multiple processes simultaneously.Cannibal
Actually there is currently no such thing as PHP6.Dissymmetry
APC is currently expected to be included in PHP 5.4. There is 'currently no such thing as PHP 5.4' but expect APC to be in PHP's core at some point. Whatever version name the release is under.Hematite
@Frank - just curious. RE: "2) Don't use apc_clear_cache() on an active server" – why exactly? Do you mean specifically if it’s a server with multiple sites on it?Vulturine
@ade There was a bug where, if max_execution_time expired before your call to apc_clear_cache() completed, APC would completely lock up apache, requiring an apache restart.Cannibal
@Frank. Sounds pretty rubbish. Good to know!Vulturine
Since this thread is a top result in Google, it should probably be updated to indicate that Zend Optimizer is merged into PHP 5.5 which was released this month. You can turn it off and use APC instead, though I'm not sure why you'd want to.Cerellia
@Cerellia Maybe you'll want to replace Zend Optimizer with APC to benefit from the user data store! AFAIK, there's no such equivalent with Zend Optimizer.Aubervilliers
@Benjamin User data store can be restored with APCu (github.com/krakjoe/apcu) which is installable and usable alongside ZO.Vandusen
M
23

Check out benchmarks and comparisons:

here and here and there

Mallee answered 31/5, 2009 at 0:12 Comment(4)
Too bad they're so old. 2006? Ewww.Antecede
I suppose we can wait a couple years and the preceding comment will be old?Insomnia
Success. It's 3 years old now. Ewwww.Vandusen
Dude it's 2016 already. Can someone redo the benchmarks a whole decade ago?Kahlil
D
13

APC definitely. It's written by the PHP guys, so even though it might not share the highest speeds, you can bet on the fact it's the highest quality.

Plus you get some other nifty features I use all the time (http://www.php.net/apc).

Dissymmetry answered 31/5, 2009 at 0:52 Comment(6)
Facebook is also a heavy user of APC -- they use gigabytes, if not terrabytes of APC cache. Many of the improvements they've made have been released back and integrated into the main version of APC.Cannibal
You are thinking of memcached.Dissymmetry
@Every FB try to hit a local APC cache before making a TCP/IP connection to memcached scribd.com/doc/4069180/…Mcafee
Probably.. but when he's talking about improvements that have been released back, etc.. that's probably Memcache. Unless they've done the same with apc.Dissymmetry
@Andy, Facebook doesn't use any of this. It uses it's own HipHop VM.Kahlil
@Kahlil a lot changes in 5 years ;) Try searching for a newer answer stackoverflow.com/…Mcafee
D
11

In the end I went with eAccelerator - the speed boost, the smaller memory footprint and the fact that is was very easy to install swayed me. It also has a nice web-based front end to clear the cache and provide some stats.

The fact that its not maintained anymore is not an issue for me - it works, and that's all I care about. In the future, if it breaks PHP6 (or whatever), then I'll re-evaluate my decision and probably go with APC simply because its been adopted by the PHP developers (so should be even easier to install)

Dorree answered 31/5, 2009 at 0:37 Comment(3)
"if it breaks PHP6"... don't you mean "when?" :)Toddler
It's funny because, 5.5 years later, there's still not a "PHP 6."Licit
@Eirik, PHP 6 is so yesterday. It's 7 now.Kahlil
A
11

It may be important to point out the current stable, unstable and dev versions of each (including date):

APC

http://pecl.php.net/package/apc

dev        dev          2013-09-12
3.1.14     beta         2013-01-02
3.1.9      stable       2011-05-14

Xcache

http://xcache.lighttpd.net/

dev/3.2     dev        2013-12-13
dev/3.1     dev        2013-11-05
3.1.0       stable     2013-10-10
3.0.4       stable     2013-10-10

eAccelerator

https://github.com/eaccelerator/eaccelerator

dev         dev        2012-08-16
0.9.6-rc1   unstable   2010-01-26
0.9.5.1     stable     2007-05-16
Apprehend answered 5/7, 2013 at 8:52 Comment(1)
Updated latest versions – Xcache looks to have most activity in both new features and patching previous versionsApprehend
D
9

In all tests I have seen, eAccelerator performs faster than any other cache out there and uses less memeory to do so. It comes with a nifty script to view cache utilisation and clear the cache etc. eAccelerator is compatible with xdebug and Zend Optimizer.

APC is being included in PHP because it is being maintained by the PHP developers. It performs very well, but not as good as eAccelerator. And it has compatability issues with Zend Optimizer.

Xcache was made by the developers of lighttpd, benchmarks show it performs similiarly to eAccelerator, and faster than APC.

So which is the best?

APC = Great if you want an easy cache that will always work with PHP, no fuss. eAccelerator = If you have time to maintain it, keep it up todate and understand how it works, it will perform faster. Long term support not as certain as APC because APC is done by the PHP devs.

Damiandamiani answered 2/12, 2010 at 13:17 Comment(0)
E
7

I tested eAccelerator and XCache with Apache, Lighttp and Nginx with a Wordpress site. eAccelerator wins every time. The bad thing is only the missing packages for Debian and Ubuntu. After a PHP update often the server doesn't work anymore if the eAccelerator modules are not recompiled.

eAccelerator last RC is from 2009/07/15 (0.9.6 rc1) with support for PHP 5.3

Embrocation answered 25/11, 2009 at 14:41 Comment(0)
K
6

I always used APC with php 5.1 and 5.2, but I had a lot of (random) errors using APC with php 5.3: Strange blank pages, random out-of-memory errors. They all disappeared when I disabled APC. But that was no option, as it is running a high-volume website.

So I tried eaccelerator. So far it has been rock solid and the speed increase is even bigger than with APC. The APC guys really need to spend some time on bugfixing.

Kapoor answered 13/6, 2011 at 16:6 Comment(2)
I had the same problems with APC and php 5.3. Thanks for the comment. PHP without any caching in my setup is much faster and reliable than with APC. The blank pages and out of memory errors were driving me crazy until I removed APC.Rigel
never figured out the reason kernel kills php-fpm because of apcSherlock
P
4

I think APC is the way to go unless you are using Zend Optimizer on the site. APC is incompatible with Zend Optimizer so in that case you will need to go with something like eAccelerator.

Poulter answered 31/5, 2009 at 7:28 Comment(1)
If your using Zend Optimizer you don't need anything else because it also does optcode caching and exposes an APC compatible interface.Hydroxide
N
3

Even both eacceleator and xcache perform quite well during moderate loads, APC maintains its stability under serious request intensity. If we're talking about a few hundred requests/sec here, you'll not feel the difference. But if you're trying to respond more, definetely stick with APC. Especially if your application has overly dynamic characteristics which will likely cause locking issues under such loads. http://www.ipsure.com/blog/2011/eaccelerator-as-zend-extension-high-load-averages-issue/ may help.

Nofretete answered 13/5, 2011 at 23:12 Comment(0)
P
2

If you want PHP file caching only, you can use eAccelerator directly. Very easy to install and configure, and give great results.

But too bad, they removed the eaccelerator_put and eaccelerator_put from the latest version 0.9.6.

Pace answered 26/9, 2010 at 15:18 Comment(0)
C
2

APC segfaults all day and all night, got no experience with eAccelerator but XCache is very reliable with loads of options and constant development.

Crespi answered 5/9, 2013 at 4:2 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.