Skip to content

Commit 630628d

Browse files
authored
Merge pull request #1011 from PowerKiKi/patch-1
Precision on when APCu cache is shared or not
2 parents ef9bc49 + 78cff89 commit 630628d

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

_posts/14-03-01-Object-Caching.md

+5-3
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,11 @@ one real limitation of APCu is that it is tied to the server it's installed on.
2020
installed as a separate service and can be accessed across the network, meaning that you can store objects in a
2121
hyper-fast data store in a central location and many different systems can pull from it.
2222

23-
Note that when running PHP as a (Fast-)CGI application inside your webserver, every PHP process will have its own cache,
24-
i.e. APCu data is not shared between your worker processes. In these cases, you might want to consider using memcached
25-
instead, as it's not tied to the PHP processes.
23+
Note that whether the cache is shared across PHP processes depends on how PHP is used. When running PHP via PHP-FPM,
24+
the cache is shared across all processes of all pools. When running PHP as a (Fast-)CGI application inside your
25+
webserver, the cache is not shared, i.e every PHP process will have its own APCu data. When running PHP as a command
26+
line, the cache is not shared and will only exist for the duration of the command. So you have to be mindful of your
27+
situation and goals. And you might want to consider using memcached instead, as it's not tied to the PHP processes.
2628

2729
In a networked configuration APCu will usually outperform memcached in terms of access speed, but memcached will be
2830
able to scale up faster and further. If you do not expect to have multiple servers running your application, or do not

0 commit comments

Comments
 (0)