APCu – 没有HIT和/或MISS。 我错过了什么?

我刚安装了php-pecl-apcu

 # yum info php-pecl-apcu Loaded plugins: amazon-id, priorities, rhui-lb 4 packages excluded due to repository priority protections Installed Packages Name : php-pecl-apcu Arch : x86_64 Version : 4.0.4 Release : 1.el7 Size : 138 k Repo : installed From repo : epel Summary : APC User Cache URL : http://pecl.php.net/package/APCu License : PHP Description : APCu is userland caching: APC stripped of opcode caching in preparation : for the deployment of Zend OPcache as the primary solution to opcode : caching in future versions of PHP. : : APCu has a revised and simplified codebase, by the time the PECL release : is available, every part of APCu being used will have received review and : where necessary or appropriate, changes. : : Simplifying and documenting the API of APCu completely removes the barrier : to maintenance and development of APCu in the future, and additionally allows : us to make optimizations not possible previously because of APC's inherent : complexity. : : APCu only supports userland caching (and dumping) of variables, providing an : upgrade path for the future. When O+ takes over, many will be tempted to use : 3rd party solutions to userland caching, possibly even distributed solutions; : this would be a grave error. The tried and tested APC codebase provides far : superior support for local storage of PHP variables. # 

在使用apc.php (查看统计信息)时,我没有看到任何HIT和/或MISS (。

这是在我的/etc/php.d/apcu.ini

 extension = apcu.so apc.enabled=1 apc.mmap_file_mask=/tmp/apc.XXXXXX apc.shm_size=128M 

我无法弄清楚我错过了什么,有什么想法?

我遇到了同样的问题,我怀疑答案在于包描述: APCu is userland caching: APC stripped of opcode caching

也就是说,APCu在function上并不等同于APC,如果您的应用程序没有明确调用它来存储自己的数据,则不会使用它。 什么通常会自动填充APCcaching将被编译的PHP代码,现在由opcache处理。