문제

I have a large site heavily depending on APC, mainly storing custom data using apc_add and apc_fetch functions.

It seems that APC is not fully compatible with PHP 5.4 and that PHP 5.5 has built in Zend OPcache. What alternative do I have to replace apc_add and apc_fetch functionality ?

Please don't mention memcached, I am already using it, but it is not suitable as direct replacement of APC because I am doing many apc_fetch calls because APC is much faster than memcached for this purpose.

Thanks for any suggestions and help.

Edit: I thought, that suggested APCu is good choice, however it has the same issues with stability (PHP segfaults)... Is there any other alternative how to store local user cache data ?

도움이 되었습니까?

해결책 3

If anyone is wondering what I have ended up doing - I use XCache now. It's surely not perfect - mainly because of its very weak (if any at all) documentation. But it's stable, maintained, and works as expected so it is pretty much good replacement of APC now.

다른 팁

There is APCu, the APC user cache: http://pecl.php.net/package/APCu

It only contains the user cache part, with apcu_* functions instead of the apc_* ones.

YAC is another alternative (https://github.com/laruence/yac). It's lockless which can lead to:

  1. better performance
  2. getting unexpected data in certain situations

If your application can tolerate (2) or is built in such a way that it's not a problem, then YAC seems like a good alternative.

APC User-Cache suitable for high load environments? also has good information about some of the issues of APCu and why YAC can solve some of those problems.

There is also an interesting discussion about php caching on reddit: http://www.reddit.com/r/PHP/comments/1k2w45/the_future_of_caching_in_php/

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top