Apc VS Eaccelerator VS Xcache

apc vs eaccelerator vs xcache

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.

Difference between Memcache, APC, XCache and other alternatives I've not heard of

First, a list of opcode cachers for php.

Second Memcache/MemcacheD is not an Opcode Cacher. It is a distributed memory caching system. It does not improve the speed/performance of your PHP code. It can be used to store data only.

APC, EAccelerator, XCache and the others are non distributed, meaning you can only store data on the local web-server. However all of these are opcode cachers and can improve the performance of your PHP app. Most, excluding EAccelerator (in the current version) can also store data.

I generally choose APC for the opcode cacher (It reportedly will be included into the core of PHP 6). However if I also have more than one web-server for the site I will also make use of MemcacheD.


Edit 1 I agree it is very annoying to setup APC, Memcache on MAMP. There are however tutorials out there dealing with such.


Edit 2 Also with regards to the best Opcode Cacher for your app really depends on which server you are using. Some work better on some systems. It also depends on the size and scale of your app as to how the cachers perform.


Edit 3 Very interesting article here about comparing performance of a few different cachers. (This article appears to be written in 2006 and should not really be used for current reference)

Should I use PHP accelerator (eAccelerator, APC, etc) in development environment?

Unless you are debugging your cacher, caching should be turned off for development.

eAccelerator vs APC

In more than 3 years, I've never seen eAccelerator used, while I've seen APC used several times.

Not sure it'll get included in PHP 6, actually -- that was said a long time ago, but I stopped hearing that after a while. Still, not hard to install by yourself.


If you look at the releases of both software :

  • APC : http://pecl.php.net/package/APC
  • eAccelerator : http://eaccelerator.net/

The first one seems to be more actively developped / maintained.

APC also has some quite well-known people in its team ;-)

On the other end, I don't recognize many names on eAccelerator's team.

Not sure it matters that much, but, generally, a known-name means someone who has a good reputation...


I'd also say APC is known to be used by some pretty big websites ; here again, it might only be reputation... But being able to say "facebook uses APC" helps when you want to convince your client he can install it safely...


About benchmarks, I have not seen any recent one -- and I follow Planet-PHP, which aggregates many blogs related to PHP.


About the configuration question : well, the more useless stuff you do, the more you waste time for nothing, obviously.

Un-used modules probably don't make that much of a difference, though -- unless you have thousand of servers, maybe... But you probably don't have that many ? ;-)

A good configuration of both Apache + MySQL + php.ini might be more useful than removing modules... I think...

Which PHP opcode cacher should I use to improve performance?

I think the answer might depend on the type of web applications you are running. I had to make this decision myself two years ago and couldn't decide between Zend Optimizer and eAccelerator.

In order to make my decision, I used ab (apache bench) to test the server, and tested the three combinations (zend, eaccelerator, both running) and proved that eAccelerator on its own gave the greatest performance.

If you have the luxury of time, I would recommend doing similar tests yourself, and making the decision based on your results.

Is eAccelerator still relevant?

PHP 5.5+ ships with the opcache extension, formerly Zend Optimiser+, by default, thereby obsoleting solutions like eAccelerator which do the same thing.

Memcached and Redis solve entirely different problems (data persistence), not code execution speed.

What's APC alternative to?

There is no built-in OP-Code or variable cache built in. But there are a number of alternatives...

I believe it was an alternative to the proprietary (and commercial) Zend Cache which was around in the late '90s and early 2000's. There are a number of different accelerators out there now (each with their own advantages and disadvantages), but in the early 2000's, the main one was Zend Cache. So I would assume (the time scales look right) that APC was meant to be an alternative to Zend Cache (an open source and free alternative)...



Related Topics



Leave a reply



Submit