apc.configuration.html

来自「php的帮助文档,涉及到PHP的案例和基本语法,以及实际应用内容」· HTML 代码 · 共 902 行 · 第 1/2 页

HTML
902
字号
     <p class="para">      On by default, but can be set to off and used in      conjunction with positive <i>apc.filters</i> so that files      are only cached if matched by a positive filter.     </p>    </dd>   </dt>   <dt id="ini.apc.filters">    <span class="term">     <i><tt class="parameter">apc.filters</tt></i>     <a href="language.types.string.html" class="type string">string</a>    </span>    <dd>     <p class="para">      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 <i>+</i> 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 <i>-</i> then anything matched      will not be cached.  The <i>-</i> case is the default, so      it can be left off.     </p>    </dd>   </dt>   <dt id="ini.apc.mmap-file-mask">    <span class="term">     <i><tt class="parameter">apc.mmap_file_mask</tt></i>     <a href="language.types.string.html" class="type string">string</a>    </span>    <dd>     <p class="para">      If compiled with MMAP support by using <i>--enable-mmap</i>      this is the mktemp-style file_mask to pass to the      mmap module for determing whether your mmap&#039;ed memory      region is going to be file-backed or shared memory      backed.  For straight file-backed mmap, set it to      something like <i>/tmp/apc.XXXXXX</i>      (exactly 6 <i>X</i>s).      To use POSIX-style shm_open/mmap put a <i>.shm</i>      somewhere in your mask.  e.g. <i>/apc.shm.XXXXXX</i>      You can also set it to <i>/dev/zero</i> to use your      kernel&#039;s <i>/dev/zero</i> interface to anonymous mmap&#039;ed      memory.  Leaving it undefined will force an anonymous mmap.     </p>    </dd>   </dt>   <dt id="ini.apc.slam-defense">    <span class="term">     <i><tt class="parameter">apc.slam_defense</tt></i>     <a href="language.types.integer.html" class="type integer">integer</a>    </span>    <dd>     <p class="para">      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 <i>apc.slam_defense</i>      to <i>75</i> 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 <i>0</i>      disables this feature.     </p>     <p class="para">      Deprecated by <a href="apc.configuration.html#ini.apc.write-lock" class="link">apc.write_lock</a>.     </p>    </dd>   </dt>   <dt id="ini.apc.file-update-protection">    <span class="term">     <i><tt class="parameter">apc.file_update_protection</tt></i>     <a href="language.types.integer.html" class="type integer">integer</a>    </span>    <dd>     <p class="para">      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 (<i>mv</i>) the file into its      permanent position when it is ready.  Many text editors, cp, tar and      other such programs don&#039;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 <i>apc.file_update_protection</i>      setting puts a delay on caching brand new files.  The      default is 2 seconds which means that if the modification      timestamp (<i>mtime</i>) 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&#039;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.     </p>    </dd>   </dt>   <dt id="ini.apc.enable-cli">    <span class="term">     <i><tt class="parameter">apc.enable_cli</tt></i>     <a href="language.types.integer.html" class="type integer">integer</a>    </span>    <dd>     <p class="para">      Mostly for testing and debugging.  Setting this enables APC      for the CLI version of PHP.  Normally you wouldn&#039;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.     </p>    </dd>   </dt>   <dt id="ini.apc.max_file_size">    <span class="term">     <i><tt class="parameter">apc.max_file_size</tt></i>     <a href="language.types.integer.html" class="type integer">integer</a>    </span>    <dd>     <p class="para">      Prevent files larger than this value from getting cached.  Defaults to      1M.      </p>    </dd>   </dt>   <dt id="ini.apc.stat">    <span class="term">     <i><tt class="parameter">apc.stat</tt></i>     <a href="language.types.integer.html" class="type integer">integer</a>    </span>    <dd>     <p class="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.     </p>     <p class="para">      For included/required files this option applies as well, but note that      if you are using relative path includes (any path that doesn&#039;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.     </p>    </dd>   </dt>      <dt id="ini.apc.write-lock">    <span class="term">     <i><tt class="parameter">apc.write_lock</tt></i>     <a href="language.types.boolean.html" class="type boolean">boolean</a>    </span>    <dd>     <p class="para">      On busy servers when you first start up the server, or when many files      are modified, you can end up with all your processes trying to compile      and cache the same files. With write_lock enabled, only one process at a      time will try to compile an uncached script while the other processes      will run uncached instead of sitting around waiting on a lock.     </p>    </dd>   </dt>      <dt id="ini.apc.report-autofilter">    <span class="term">     <i><tt class="parameter">apc.report_autofilter</tt></i>     <a href="language.types.boolean.html" class="type boolean">boolean</a>    </span>    <dd>     <p class="para">      Logs any scripts that were automatically excluded from being cached due      to early/late binding issues.     </p>    </dd>   </dt>      <dt id="ini.apc.include-once-override">    <span class="term">     <i><tt class="parameter">apc.include_once_override</tt></i>     <a href="language.types.boolean.html" class="type boolean">boolean</a>    </span>    <dd>     <p class="para">      Optimize <b>include_once()</b> and <b>require_once()</b>      calls and avoid the expensive system calls used.     </p>    </dd>   </dt>      <dt id="ini.apc.rfc1867">    <span class="term">     <i><tt class="parameter">apc.rfc1867</tt></i>     <a href="language.types.boolean.html" class="type boolean">boolean</a>    </span>    <dd>     <p class="para">      RFC1867 File Upload Progress hook handler is only available if you      compiled APC against PHP 5.2.0 or later. When enabled, any file uploads      which includes a field called <i>APC_UPLOAD_PROGRESS</i>      before the file field in an upload form will cause APC to automatically      create an upload_<em class="emphasis">key</em> user cache entry where      <em class="emphasis">key</em> is the value of the      <i>APC_UPLOAD_PROGRESS</i> form entry.     </p>     <p class="para">      Note that the file upload tracking is not threadsafe at this point, so      new uploads that happen while a previous one is still going will disable      the tracking for the previous.     </p>     <p class="para">      <div class="example">       <p><b>Example #1 An apc.rfc1867 example</b></p>       <div class="example-contents"><div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />print_r</span><span style="color: #007700">(</span><span style="color: #0000BB">apc_fetch</span><span style="color: #007700">(</span><span style="color: #DD0000">"upload_$_POST[APC_UPLOAD_PROGRESS]"</span><span style="color: #007700">));<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>       </div>       <div class="example-contents"><p>The above example will output something similar to:</p></div>       <div class="example-contents"><pre><div class="cdata"><pre>Array(    [total] =&gt; 1142543    [current] =&gt; 1142543    [rate] =&gt; 1828068.8    [filename] =&gt; test    [name] =&gt; file    [temp_filename] =&gt; /tmp/php8F    [cancel_upload] =&gt; 0    [done] =&gt; 1)</pre></div>       </pre></div>      </div>     </p>    </dd>   </dt>      <dt id="ini.apc.rfc1867_prefix">    <span class="term">     <i><tt class="parameter">apc.rfc1867_prefix</tt></i>     <a href="language.types.string.html" class="type string">string</a>    </span>    <dd>     <p class="para">      Key prefix to use for the user cache entry generated by rfc1867 upload      progress functionality.     </p>    </dd>   </dt>   <dt id="ini.apc.rfc1867_name">    <span class="term">     <i><tt class="parameter">apc.rfc1867_name</tt></i>     <a href="language.types.string.html" class="type string">string</a>    </span>    <dd>     <p class="para">      Specify the hidden form entry name that activates APC upload progress      and specifies the user cache key suffix.     </p>    </dd>   </dt>   <dt id="ini.apc.rfc1867_freq">    <span class="term">     <i><tt class="parameter">apc.rfc1867_freq</tt></i>     <a href="language.types.string.html" class="type string">string</a>    </span>    <dd>     <p class="para">      The frequency that updates should be made to the user cache entry for      upload progress.  This can take the form of a percentage of the total      file size or a size in bytes optionally suffixed with &#039;k&#039;, &#039;m&#039;, or &#039;g&#039;      for kilobytes, megabytes, or gigabytes respectively (case insensitive).      A setting of 0 updates as often as possible, which may cause slower      uploads.     </p>    </dd>   </dt>   <dt id="ini.apc.localcache">    <span class="term">     <i><tt class="parameter">apc.localcache</tt></i>     <a href="language.types.boolean.html" class="type boolean">boolean</a>    </span>    <dd>     <p class="para">      This enables a lock-free local process shadow-cache which reduces lock      contention when the cache is being written to.     </p>    </dd>   </dt>      <dt id="ini.apc.localcache.size">    <span class="term">     <i><tt class="parameter">apc.localcache.size</tt></i>     <a href="language.types.integer.html" class="type integer">integer</a>    </span>    <dd>     <p class="para">      The size of the local process shadow-cache, should be set to a      sufficently large value, approximately half of      <a href="apc.configuration.html#ini.apc.num-files-hint" class="link">apc.num_files_hint</a>.     </p>    </dd>   </dt>   <dt id="ini.apc.coredump_unmap">    <span class="term">     <i><tt class="parameter">apc.coredump_unmap</tt></i>     <a href="language.types.boolean.html" class="type boolean">boolean</a>    </span>    <dd>     <p class="para">      Enables APC handling of signals, such as SIGSEGV, that write      core files when signaled. When these signals are received,      APC will attempt to unmap the shared memory segment in order      to exclude it from the core file. This setting may improve      system stability when fatal signals are received and a large       APC shared memory segment is configured.     </p>     <div class="warning"><b class="warning">Warning</b>      <p class="para">       This feature is potentially dangerous. Unmapping the shared       memory segment in a fatal signal handler may cause undefined       behaviour if a fatal error occurs.      </p>     </div>     <blockquote><p><b class="note">Note</b>:              Although some kernels may provide a facility to ignore various       types of shared memory when generating a core dump file, these        implementations may also ignore important shared memory segments       such as the Apache scoreboard.      <br />     </p></blockquote>    </dd>   </dt>     </dl> </p></div><hr /><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="apc.installation.html">Installation</a></div> <div class="next" style="text-align: right; float: right;"><a href="apc.resources.html">Resource Types</a></div> <div class="up"><a href="apc.setup.html">Installing/Configuring</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div></body></html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?