新的 APCu APC 用户缓存是否在进程之间共享?

Is the new APCu APC User Cache shared between processes?

我打算使用 php5-apcu ubuntu 包。

进程之间是否共享数据?换句话说,如果我在一个网站加载中设置一个缓存条目,另一个网站加载是否会有缓存条目可用,即使它是由另一个进程提供的?

这是如何工作的:

https://github.com/krakjoe/apcu/issues/121

The rule is that only child processes can access what their parent created; In FCGI spawned processes are not necessarily a child of their parent, they may not be actual forks. If your process manager works like conventional FCGI/CGI then you will not be able to share, if it works like FPM, and initializes PHP in a parent and forks child interpreters then you will have no problem.

A​​pache 的 prefork 和 PHP 的 FPM 将在工作进程之间共享(通过父进程的内存 space)。

CLI 不会,因为每个 CLI 调用都是一个单独的进程。

您可能会考虑将 memcached 或 redis 之类的东西作为替代方案。