ArticleDirectory
I. Software Packages
A) APC-3.0.18.tgz
Ii. installation and configuration
A) tar zxvf APC-3.0.18.tgz
B) CD APC-3.0.18
C ). /configure -- enable-APC-MMAP -- With-apxs =/usr/local/Apache/bin/apxs -- With-PHP-Config =/usr/local/PHP /bin/PHP-config
D) Make make test
E) make install
F) CD/usr/local/PHP/lib
G) Add the following statement to vi php. ini:
H) extension_dir = "/usr/local/PHP/lib/PHP/extensions/no-debug-non-zts-20060613"
I) Extension = "APC. So"
J) [APC]
K) APC. TTL = 7200
L) APC. Enabled = 1
M) APC. shm_size = 60
N)/usr/local/Apache/bin/apachectl-K stop
O)/usr/local/Apache/bin/apachectl-K start
P) mV APC. php/usr/local/Apache/htdocs/
Q) http: // localhost/APC. php
R)
Iii. Description of relevant parameters
[APC]
; Alternative PHP cache for caching and optimizing PHP intermediateCode
APC. cache_by_default = on
; Sys
Whether to enable caching for all files by default.
If it is set to off and used together with the APC. Filters command starting with the plus sign, the file is cached only when the filter is matched.
APC. enable_cli = off
; Sys
Whether to enable the APC function for the CLI version. This command is enabled only for testing and debugging purposes.
APC. Enabled = on
Whether to enable APC. If APC is statically compiled into PHP and you want to disable it, this is the only way.
APC. file_update_protection = 2
; Sys
When you modify a file on a running server, you should perform atomic operations.
That is, first write a temporary file, and then rename the file (MV) to the final name.
The text editor, CP, tar, and other programs do not perform this operation, which may cause buffering of incomplete files.
The default value is 2, indicating that the file is not buffered if the modification time is found to be less than 2 seconds away from the Access time.
The unfortunate visitor may get incomplete content, but this bad effect will not be extended through the cache.
If you can ensure that all update operations are atomic operations, disable this feature with 0.
; If your system updates slowly due to a large number of Io operations, you need to increase this value.
APC. Filters =
; Sys
; A list of POSIX extension Regular Expressions separated by commas.
If the source file name matches any mode, the file is not cached.
Note: The file name used for matching is the file name passed to include/require, rather than the absolute path.
If the first character of the regular expression is "+", it means that all files matching the expression will be cached,
If the first character is "-", all matching items will not be cached. "-" Is the default value and can be omitted.
APC. TTL = 0
; Sys
The number of seconds that cache entries can stay in the buffer. 0 indicates never timeout. Recommended Value: 7200 ~ 36000.
If it is set to 0, the buffer may be filled with old cache entries, resulting in the inability to cache new entries.
APC. user_ttl = 0
; Sys
; Similar to APC. TTL, the recommended value is 7200 ~ for each user ~ 36000.
If it is set to 0, the buffer may be filled with old cache entries, resulting in the inability to cache new entries.
APC. gc_ttl = 3600
; Sys
The number of seconds that cache entries can exist in the garbage collection table.
This value provides a security measure, even if a server process crashes when the cached source file is executed,
And the source file has been modified, and the memory allocated for the old version will not be recycled until the TTL value is reached.
If it is set to zero, this feature is disabled.
APC. include_once_override = off
; Sys
; Keep it off. Otherwise, unexpected results may occur.
APC. max_file_size = 1 m
; Sys
; Files larger than this size cannot be cached.
APC. mmap_file_mask =
; Sys
; If you use? Enable-MMAP (enabled by default) is used to compile MMAP support for APC,
The value here is the mktemp file mask passed to the MMAP module (Recommended Value: "/tmp/APC. xxxxxx ").
The mask is used to determine whether the memory ing area is file-backed or shared memory backed.
For direct file-backed memory ing, set it to "/tmp/APC. xxxxxx" (exactly 6 X ).
To use the POSIX shm_open/MMAP style, you must set it to "/APC. SHM. xxxxxx.
You can also set it to "/dev/Zero" to use the kernel "/dev/Zero" interface for anonymous ing memory.
If this command is not defined, anonymous ing is mandatory.
APC. num_files_hint = 1000
; Sys
The approximate number of different source files that may be contained or requested on the Web server (Recommended Value: 1024 ~ 4096 ).
If you are not sure, set it to 0. This setting is mainly used for websites with thousands of source files.
APC. Optimization = 0
; Optimization level (Recommended Value: 0 ).
The positive integer value indicates that the optimizer is enabled. The higher the value, the more radical optimization is used.
; A higher value may have a very limited speed increase, but it is still being tested.
APC. report_autofilter = off
; Sys
; Whether to record all scripts that are automatically not cached due to early/late binding.
APC. shm_segments = 1
; Sys
; The number of shared memory blocks allocated to the compiler buffer (Recommended Value: 1 ).
If APC consumes shared memory and the APC. shm_size command is set to the maximum value allowed by the system,
; You can try to increase this value.
APC. shm_size = 30
; Sys
; The size of each shared memory block (in MB, recommended value: 128 ~ 256 ).
Some systems (including most BSD variants) have very few default shared memory blocks.
APC. slam_defense = 0
; Sys (opposed to using this command, we recommend using the APC. write_lock command)
On very busy servers, whether it is to start the service or modify files,
; May be caused by multiple processes attempting to cache a file at the same time.
This command is used to set the percentage of cached steps skipped by a process when processing files that are not cached.
For example, if the value is set to 75, 75% of the probability of Files Not cached is met, thus reducing the chance of collision.
We recommend that you set it to 0 to disable this feature.
APC. Stat = on
; Sys
; Whether to enable the script Update check.
Be very careful when changing the command value.
The default value on indicates that APC checks whether the script is updated every time it requests the script,
If updated, the compiled content is automatically re-compiled and cached. However, this has a negative impact on performance.
If it is set to off, the check is not performed, which greatly improves the performance.
However, to make the updated content take effect, you must restart the web server.
This command is also valid for include/require files. However, you must note that,
If you are using a relative path, APC must check each include/require operation to locate the file.
The use of absolute paths can skip the check, so you are encouraged to use absolute paths for the include/require operation.
APC. user_entries_hint = 100
; Sys
; Similar to the num_files_hint command, only for different users.
If you are not sure, set it to 0.
APC. write_lock = on
; Sys
Whether to enable the write lock.
On very busy servers, whether it is to start the service or modify files,
; May be caused by multiple processes attempting to cache a file at the same time.
; Enable this command to avoid competition conditions.
APC. rfc1867 = off
; Sys
After this command is enabled, for each upload file that contains the apc_upload_progress field just before the file field,
APC will automatically create an upload _ User cache entry (that is, the value of the apc_upload_progress field ).