我刚刚安装了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
我不知道我错过了什么,有什么想法吗?
答案1
我遇到了同样的问题,我怀疑答案就在包裹描述中:APCu is userland caching: APC stripped of opcode caching
也就是说,APCu 在功能上并不等同于 APC,如果您的应用程序没有明确调用它来存储自己的数据,则不会使用它。通常自动填充 APC 缓存的是编译后的 php 代码,现在由 opcache 处理。