If compiled with MMAP support by using --enable-mmap
this is the mktemp-style file_mask to pass to the
mmap module for determing whether your mmap'ed memory
region is going to be file-backed or shared memory
backed. For straight file-backed mmap, set it to
something like /tmp/apc.XXXXXX
(exactly 6 Xs).
To use POSIX-style shm_open/mmap put a .shm
somewhere in your mask. e.g. /apc.shm.XXXXXX
You can also set it to /dev/zero to use your
kernel's /dev/zero interface to anonymous mmap'ed
memory. Leaving it undefined will force an anonymous mmap.

On very busy servers whenever you start the server or
modify files you can create a race of many processes
all trying to cache the same file at the same time.
This option sets the percentage of processes that will
skip trying to cache an uncached file. Or think of it
as the probability of a single process to skip caching.
For example, setting apc.slam_defense
to 75 would mean that there is
a 75% chance that the process will not cache an uncached
file. So, the higher the setting the greater the defense
against cache slams. Setting this to 0
disables this feature.

When you modify a file on a live web server you really
should do so in an atomic manner. That is, write to a
temporary file and rename (mv) the file into its
permanent position when it is ready. Many text editors, cp, tar and
other such programs don't do this. This means that there
is a chance that a file is accessed (and cached) while it
is still being written to. This apc.file_update_protection
setting puts a delay on caching brand new files. The
default is 2 seconds which means that if the modification
timestamp (mtime) on a file shows that it is less than 2
seconds old when it is accessed, it will not be cached.
The unfortunate person who accessed this half-written file
will still see weirdness, but at least it won't persist.
If you are certain you always atomically update your files
by using something like rsync which does this correctly, you
can turn this protection off by setting it to 0. If you
have a system that is flooded with io causing some update
procedure to take longer than 2 seconds, you may want to
increase this a bit.

Mostly for testing and debugging. Setting this enables APC
for the CLI version of PHP. Normally you wouldn't want to
create, populate and tear down the APC cache on every CLI
request, but for various test scenarios it is handy to be
able to enable APC for the CLI version of APC easily.

资源类型

本扩展模块未定义任何资源类型。

预定义常量

本扩展模块未定义任何常量。

Table of Contents

apc_add — Cache a variable in the data store (only if it's not stored)