|
|
 |
III. Alternative PHP Cache
The Alternative PHP Cache (APC) is a free and open opcode cache for PHP.
It was conceived of to provide a free, open, and robust framework for
caching and optimizing PHP intermediate code.
Esta extension PECL no esta ligada a PHP.
Mas informacion sobre nuevos lanzamientos,
descargas ficheros de fuentes, informacion sobre los responsables asi
como un 'CHANGELOG', se puede encontrar aqui:
http://pecl.php.net/package/apc.
Podeis descargar esta
DLL de las extensiones PECL
desde la pagina PHP
Downloads o desde
http://snaps.php.net/.
Nota:
On Windows, APC expects c:\tmp to exist, and be
writable by the web server.
El comportamiento de estas
funciones está afectado por los valores definidos en
php.ini.
Although the default APC settings are fine for many installations, serious
users should consider tuning the following parameters.
Tabla 1. APC configuration options | Name | Default | Changeable | Changelog |
|---|
| apc.enabled | "1" | PHP_INI_ALL | | | apc.shm_segments | "1" | PHP_INI_SYSTEM | | | apc.shm_size | "30" | PHP_INI_SYSTEM | | | apc.optimization | "0" | PHP_INI_ALL | | | apc.num_files_hint | "1000" | PHP_INI_SYSTEM | | | apc.ttl | "0" | PHP_INI_SYSTEM | | | apc.gc_ttl | "3600" | PHP_INI_SYSTEM | | | apc.cache_by_default | "1" | PHP_INI_SYSTEM | | | apc.filters | NULL | PHP_INI_SYSTEM | | | apc.mmap_file_mask | NULL | PHP_INI_SYSTEM | | | apc.slam_defense | "0" | PHP_INI_SYSTEM | | | apc.file_update_protection | "2" | PHP_INI_SYSTEM | | | apc.enable_cli | "0" | PHP_INI_SYSTEM | > APC 3.0.6 |
For further details and definitions of the
PHP_INI_* constants, see the Apéndice G.
A continuación se
presenta una corta explicación de las directivas de
configuración.
- apc.enabled
boolean
apc.enabled can be set to 0 to disable APC. This is
primarily useful when APC is statically compiled
into PHP, since there is no other way to disable
it (when compiled as a DSO, the extension
line in php.ini can just be commented-out).
- apc.shm_segments
integer
The number of shared memory segments to allocate
for the compiler cache. If APC is running out of
shared memory but you have already set
apc.shm_size as high as your system allows, you
can try raising this value.
- apc.shm_size
integer
The size of each shared memory segment in MB.
By default, some systems (including most BSD
variants) have very low limits on the size of a
shared memory segment.
- apc.optimization
integer
The optimization level. Zero disables the
optimizer, and higher values use more aggressive
optimizations. Expect very modest speed
improvements. This is experimental.
- apc.num_files_hint
integer
A "hint" about the number of distinct source files
that will be included or requested on your web
server. Set to zero or omit if you're not sure;
this setting is mainly useful for sites that have
many thousands of source files.
- apc.ttl
integer
The number of seconds a cache entry is allowed to
idle in a slot in case this cache entry slot is
needed by another entry. Leaving this at zero
means that your cache could potentially fill up
with stale entries while newer entries won't be
cached.
- apc.gc_ttl
integer
The number of seconds that a cache entry may
remain on the garbage-collection list. This value
provides a fail-safe in the event that a server
process dies while executing a cached source file;
if that source file is modified, the memory
allocated for the old version will not be
reclaimed until this TTL reached. Set to zero to
disable this feature.
- apc.cache_by_default
boolean
On by default, but can be set to off and used in
conjunction with positive apc.filters so that files
are only cached if matched by a positive filter.
- apc.filters
string
A comma-separated list of POSIX extended regular
expressions. If any pattern matches the source
filename, the file will not be cached. Note that
the filename used for matching is the one passed
to include/require, not the absolute path. If the
first character of the expression is a + then the
expression will be additive in the sense that any
files matched by the expression will be cached, and
if the first character is a - then anything matched
will not be cached. The - case is the default, so
it can be left off.
- apc.mmap_file_mask
string
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.
- apc.slam_defense
integer
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.
- apc.file_update_protection
integer
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.
- apc.enable_cli
integer
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.
Esta extensión no tiene
ningún tipo de recurso definido. Esta extensión no tiene ninguna
constante definida.
add a note
User Contributed Notes
Alternative PHP Cache
There are no user contributed notes for this page.
| |
|
| Chiste de... Abogados | | No sé qué decir | El abogado está hablando con su cliente, que acaba de ser condenado a la pena capital.
- Sinceramente, ya no sé qué decir para librarte de la silla eléctrica.
- ¿Y por qué no dices que has sido tú? | | Chistes en tu mail | | ©ContenidosGratis |
| Inicio | Acción | Estrategia | Palabras | Puzzles | Solitarios | Foro Trucos |  | Cake Mania Jugadores: 6835 Categoría del juego: Acción Objetivo del juego: Ayuda a Jill a recuperar la pastelería de su abuela llevando su propia pastelería; consigue clientes y gana dinero. |
|  | Rainbow Web Jugadores: 2199 Categoría del juego: Puzzles Objetivo del juego: Rompe un pegajoso hechizo y salva un reino de fantasía en Rainbow Web. Tendrás toneladas de diversión mientras juegas a este mágico desafío para la mente. |
|  | Mahjongg Fortuna Jugadores: 12462 Categoría del juego: Solitarios Objetivo del juego: Velocidad y habilidad mental son las armas más importantes en esta versión de un antiguo juego asiático. Despeja el tablero lo antes posible haciendo clic en las fichas iguales y gánate la fama eterna de la puntuación más alta. |
|  | Chainz 2 Jugadores: 6955 Categoría del juego: Puzzles Objetivo del juego: Entra en el mundo de las combinaciones con Chainz 2: Relinked, emocionante secuela del exitazo del año pasado, Chainz. Gira eslabones y crea combinaciones de 3 ó más. |
|  | Delicious Jugadores: 4405 Categoría del juego: Acción Objetivo del juego: ¿Eres un as de la multitarea? ¿Quieres que tus clientes estén contentos? ¡Pues Delicious es tu juego! Sacia el apetito de los clientes y tenlos contentos; ¡no te arriesgues! |
|  | Bookworm Jugadores: 4568 Categoría del juego: Palabras Objetivo del juego: Junta las letras para formar palabras. ¡Las palabras más largas valen más puntos! |
|  | Zuma Jugadores: 4976 Categoría del juego: Acción Objetivo del juego: Controla el ídolo de la rana de piedra de los antiguos Zuma en este intrigante enigma de acción. ¡Dispara bolas para formar conjuntos de tres, pero si dejas que lleguen a la calavera dorada morirás! |
|  | Jewel of Atlantis Jugadores: 3798 Categoría del juego: Puzzles Objetivo del juego: Descubre la ciudad hundida de la Atlántida y busca valiosos tesoros. Viaja más allá de las profundidades del mar y vive trepidantes aventuras en Jewel of Atlantis. |
|  | Jewel Quest Jugadores: 3727 Categoría del juego: Puzzles Objetivo del juego: Convierte la arena de la antigua selva en oro tan rápido como puedas juntando grupos de 3 elementos. ¡Los grupos más grandes valen más puntos! |
|  | Bejeweled 2 Jugadores: 3659 Categoría del juego: Puzzles Objetivo del juego: Con cuatro modos de juego únicos y fascinantes, nuevas piezas de juego explosivas e imponentes fondos planetarios, Bejeweled 2 es mucho más adictivo que nunca. |
|
|