Update APC docs

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@209162 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Rasmus Lerdorf 2006-03-12 02:16:54 +00:00
parent a5e082b328
commit 2f2535bab9
2 changed files with 81 additions and 5 deletions

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.5 $ -->
<!-- $Revision: 1.6 $ -->
<section id="apc.configuration">
&reftitle.runtime;
&extension.runtime;
@ -7,6 +7,30 @@
Although the default APC settings are fine for many installations, serious
users should consider tuning the following parameters.
</para>
<para>
There are two main decisions you have to make. First, how much shared
memory do you want to set aside for APC, and second, whether you want APC
to check if a file has been modified on every request. The two ini
directives involved here are <literal>apc.shm_size</literal> and
<literal>apc.stat</literal>. Read the sections on these two directives
carefully below.
</para>
<para>
Once you have a running server, you should copy the
<literal>apc.php</literal> script that comes with the extension to
somewhere in your docroot and load it up in your browser. It provides
you with a detailed look at what is happening in your cache. If you
have GD enabled in PHP, it will even have pretty graphs. First thing
to check is of course that it is actually caching files. Assuming it is
working you should then pay close attention to the <literal>Cache full
count</literal> number on the left. That tells you the number of times
the cache has filled up and has had to forcefully clean up any entries
not accessed within the last <literal>apc.ttl</literal> seconds. You
should configure your cache to minimize this number. If you are constantly
filling your cache, the resulting cache churn is going to hurt performance.
You should either set more memory aside for APC, or use
<literal>apc.filters</literal> to cache fewer scripts.
</para>
<para>
<table>
<title>APC configuration options</title>
@ -98,6 +122,18 @@
<entry>PHP_INI_SYSTEM</entry>
<entry>&gt; APC 3.0.6</entry>
</row>
<row>
<entry>apc.max_file_size</entry>
<entry>"1M"</entry>
<entry>PHP_INI_SYSTEM</entry>
<entry>&gt; APC 3.0.6</entry>
</row>
<row>
<entry>apc.stat</entry>
<entry>"1"</entry>
<entry>PHP_INI_SYSTEM</entry>
<entry>&gt; APC 3.0.9</entry>
</row>
</tbody>
</tgroup>
</table>
@ -337,6 +373,43 @@
</para>
</listitem>
</varlistentry>
<varlistentry id="ini.apc.max_file_size">
<term>
<parameter>apc.max_file_size</parameter>
<type>integer</type>
</term>
<listitem>
<para>
Prevent files larger than this value from getting cached. Defaults to
1M.
</para>
</listitem>
</varlistentry>
<varlistentry id="ini.apc.stat">
<term>
<parameter>apc.stat</parameter>
<type>integer</type>
</term>
<listitem>
<para>
Be careful if you change this setting. The default is for this to be On
which means that APC will stat (check) the script on each request to see
if it has been modified. If it has been modified it will recompile and
cache the new version. If you turn this setting off, it will not check.
That means that in order to have changes become active you need to
restart your web server. On a production server where you rarely
change the code, turning stats off can produce a significant performance
boost.
</para>
<para>
For included/required files this option applies as well, but note that
if you are using relative path includes (any path that doesn't start
with / on Unix) APC has to check in order to uniquely identify the file.
If you use absolute path includes APC can skip the stat and use that
absolute path as the unique identifier for the file.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</section>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.4 $ -->
<!-- $Revision: 1.5 $ -->
<!-- Purpose: basic.php -->
<!-- Membership: pecl -->
@ -31,13 +31,16 @@
</para>
<note>
<simpara>
On Windows, APC expects <literal>c:\tmp</literal> to exist, and be
writable by the web server.
On Windows, APC needs a temp path to exist, and be
writable by the web server. It checks TMP, TEMP,
USERPROFILE environment variables in that order
and finally tries the WINDOWS directory if none of
those are set.
</simpara>
</note>
<note>
<simpara>
For more in-depth, highly technical documentation, see the
For more in-depth, highly technical implementation details, see the
<ulink url="&url.apc.technotes;">
developer-supplied TECHNOTES file
</ulink>.