开发者

File or APC Cache Engine in CakePHP?

CakePHP offers support for APC, XCache and Memcache in addition to its default caching engine. Having had some problems with my application sporadically caching broken pages for no known reason, I've decided to try another engine to see if that makes a difference.

XCache and Memcache both seem as though they might take a little bit more setup, but APC appears to be literally a case of changing one line in the core.php. My question is, where can I find information about why I should choose APC over the default engine? What are the pros and cons? It can't really be a case of "just try them both and see if one feels better than the other" (can it?), but a basic snoop around hasn't revealed a simple breakdown of the differing merits of cache engines in Cake.

Can anyone explain the mysterious workings of cache engines in Cake to me? Or point me to a resource that does? Bonus points if XCache and Memcache are also compared, because they m开发者_运维问答ight be my next port of call...


Files are on disk :

  • Not quite fast ; and concurrent access are not great at all, if several processes try to read/write at the same time
  • Local to one server (if you have several servers, you'll have to store the files on each one of them -- NFS being slow)
  • But you have a lot of space


APC is in memory :

  • Really fast
  • But you have less space
  • And it's local to each server too


memcached is in memory, on a network cluster :

  • quite fast (a bit less than APC ; but still pretty fast)
  • Shared between all your servers : each item has to be cached only once, even if you have several webservers.
  • You can have several servers in your memcached cluster (which means virtually no limit in the size of the cache)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜