tags:

views:

164

answers:

2

There are various problems when using php_apc with symfony,

If the boost is not so significant,I'm going to replace apc with memcached.

+1  A: 

See this please :)

Memcached is a distributed caching system, whereas APC is non-distributed - and mainly an opcode cache.

If (and only if) you have a web application which has to live on different webservers (loadbalancing), you have to use memcache for distributed caching. If not, just stick to APC and its cache.

You should always use an opcode cache, which APC is (also APC will get integrated into php6 iirc, so why not start using it now).

You can/should use both for different purposes.

Sarfraz
But apc is so buggy that I can hardly tolerant..
@user198729: then you should go for memecache :) by the way there are big apps already using apc.
Sarfraz
+2  A: 

APC and memcached are not the same things :


Fisrt of all, APC has two roles :

  • It's an opcode cache (which means each PHP page will generally require less CPU, as it remove the "compilation" part ; the first time we enabled APC as an opcode cache, CPU load on our webservers went from something like 80% to something like 40-50%)
  • It's also a non-distributed data cache
    • which means, if you have several servers, that each one of your servers has a local copy of the cache
    • which also means there is a pretty low limit on the amount of data you can store in cache


And for memcached :

  • It's only a data-cache
  • It's distributed
    • i.e. no limit on the number of servers in a memcached cluster
    • i.e. no limit on the amount of cache you can have


You can use either APC or memcached, or both, as a data-cache (that's what we are doing on the project I'm currently working on : some data are cached in APC, and some others using memcached).

But, if you want some opcode cache, you'll have to go with APC (or eAccelerator ; but not sure it's well maintained).

Pascal MARTIN
What's the version of PHP and apc respectively?
Almost last "stable" version of PHP 5.2 *(i.e. something like 5.2.9 or 5.2.10)*, and last "stable" version of APC *(i.e. 3.0.19)*
Pascal MARTIN
I've heard apc is stable with PHP5.2,but I'm already using PHP5.3,and the apc version is 3.1.3.0,which seems buggy
Pascal MARTIN