views:

253

answers:

1

Ok I have read a lot of posts and articles on how GREAT eAccelerator is, I tested it on my home dev server and it slowed my pages down pretty noticably, could it be because:

  • I don't have a lot of RAM?
  • It only works to improve the speed of code sometimes?
  • All the hype is false?
  • Other?
+1  A: 

Hi,

I have never used eAccelerator, but I always work with APC :

A few things I've noted (I don't really know about eAccelerator, but I guess the ideas are the same) :

  • First access will not be faster : it has to compile PHP into opcode, and store it in memory ; only next access will be faster (it will not have to re-compile)
  • Activating APC, I've seen a CPU-load drop that can go up to 50% (ie, 80% of the server's CPU used before activating APC ; between 40% and 50% of CPU used with APC activated)
  • If not well configured, there was no real loss of performance, but things where not great either.
    • For instance, if not enough RAM is given to APC, and it is full, APC will have to remove some entries from the cache to be able to store new ones ; in the end, it'll spend quite some time to cache things, to un-cache them just after to cache new ones, and this, for each page-request. So, not good.
    • Another example is the "apc.stat" config entry (maybe there's something like this for eAccelerator) : if it's set to 1, for each accessed file, APC will check on disk if it has been modified, compared to the version in cache. If set to 0, APC will always use the version in cache, without checking the version on disk (it means you'll have to flush the cache to have a modification on a file be taken into account) ; setting this option to 0 can mean a drop of between 5 and 10 % of CPU load

If you are using Windows, things might not be as bright as you'd hope ; not sure if it could decrease performance, but Apache+PHP on windows is generally slower than Apache+PHP on linux (Once, I set up a virtual machine running a LAP stack ; it was responding as fast as running WAP on the physical machine ^^ )


Now, a couple of questions :

  • Which versions of Apache / PHP are you using ?
    • Maybe a "too recent" version ?
  • It seems there has been no new version of eAccelerator for quite some time, now ; last version is from May 2008 ; the previous one was from september 2007

Have you tried with APC, on which there is apparently more work done ?
What kind of result would you get with that one ?


Finally, for more informations, could you give us more informations about your environment and configuration ? And some details on the kind of benchmark you ran ?
Thanks :-)

Pascal MARTIN