Jump to navigation Jump to search

Coral: php apc

5,213 bytes added, 13:43, 12 November 2011
Created page with "<div id="top" style="margin:0;padding: 0px 0px 0px 5px; color: #000; background-color: #FFFFEB; border: 1px solid darkslateblue;"><span id="top" style="margin:0;padding: 0px;font..."
<div id="top" style="margin:0;padding: 0px 0px 0px 5px; color: #000; background-color: #FFFFEB; border: 1px solid darkslateblue;"><span id="top" style="margin:0;padding: 0px;font-size:12px">'''''Coral'' :'''&nbsp; [[Coral: php intro|PHP]] | [[Coral: php short open_tags|PHP - Short open tags]] | [[Coral: php pear|PHP - PEAR Auto Install]] | [[Coral: php pear manual install|PHP - PEAR Manual Install]] | [[Coral: php apc|PHP - APC]]</span></div>

<span style="margin-bottom:5px;font-size:25px;color: #31799F;">PHP - APC</span>

The APC administrator interface is a PHP script named '''apc.php''' located in folder UniServer\home\us_extra. It can be accessed using UniController

<span style="padding:6px;background-color:#99FFFF"> Server Configuration > PHP > PHP Accelerators </span>

Alternatively, you can type the following into your browser: http://localhost/us_extra/apc.php

This page covers the administrator interface menu bar and fine-tuning the cache.


{| cellpadding="0" cellspacing="0" style="margin-left:6px;margin-bottom:5px;padding-left:6px;padding-right:6px;font-size:11px;background-color: #FFFFEB;border: 1px solid darkslateblue;"
|colspan="2" style="font-weight:bold;"| UniServer&nbsp;8-Coral
|&nbsp;||[[Coral: Introduction|Home]]
|&nbsp;||[[Coral: start quick start|Quick Start]]
|&nbsp;||[[Coral: general intro|General]]
|&nbsp;||[[Coral: apache intro|Apache]]
|&nbsp;||[[Coral: mysql intro|MySQL]]
|<span style="font-size: 14px;">ยป</span>||[[Coral: php intro|PHP]]
|&nbsp;||[[Coral: msmtp intro|MSMTP]]
|&nbsp;||[[Coral: cron intro|CRON]]
|&nbsp;||[[Coral: dtdns intro|DtDNS]]
|&nbsp;||[[Coral: dbbackup intro|Db Backup]]
|&nbsp;||[[Coral: perl intro|Perl]]
|&nbsp;||[[Coral: index main|Main Index]]

==APC administrator menu==
The APC administrator interface has the following menu options allowing you to view usage or inspect cached variables.


'''Refresh Data''' <br />
This captures the current cache status and updates the statistics.

'''View Host Stats'''<br />
This option allows you to view the current cache status, general cache information, and usage and statistics on hits and misses. Information displayed covers both the system cache (which handles opcodes) and the user cache (which handles user variables). Various other statistics are displayed, such as the number of cache requests per second, hit rate and miss rate.

This information allows you identify areas that are under-optimized. For example, the cache full count value indicates how often the cache has filled up. A high number indicates high cache churn. To reduce this, assign more memory to the cache.

'''System Cache Entries'''<br />
The System Cache Entries menu lists the PHP scripts that are currently being cached, together with their filename, size and number of hits. APC automatically caches each script's opcodes.

'''Note''': You can clear the opcode cache at any time with the '''Clear cache''' button top right of the page.

'''User Cache Entries'''<br />
The User Cache Entries menu lists user variables that have been stored in the cache, together with their identifier, size, and creation and modification times. You can select any of these entries to look inside the cache entry and see what it contains. User cache entries are not automatically created by APC. They are the result of specific instructions in a PHP script.

'''Note''': You can clear the user cache at any time with the '''Clear cache''' button top right of the page.

'''''[[#top | Top]]'''''
==Tuning the cache==
The Uniform Server default '''apc.shm_size''' memory size is '''64M''', which should be adequate for most small applications. The setting is application specific. It may require adjusting to avoid fragmentation and cache churning. To determine if changes are required, open the APC control panel and check the following:

* Under '''File Cache Information''', check Cache Full Count. If it's greater than zero, the cache is filling up and churning. This is because there is not enough memory allocated. Resolve this by increasing the memory allocation (apc.shm_size).
* Under '''Detailed Memory Usage and Fragmentation''' the Fragmentation value should be 0% (this may occasionally vary). A non-zero value is probably due to cache churning. Solve this the same as above.

Fragmentation occurs when cached items expire and new items fill their vacated memory space. The new item maybe slightly smaller than the old item and the remaining memory space may be too small for a new cache item. This unused memory space is referred to as fragmentation.

To avoid fragmentation, ensure you run your servers during high traffic conditions and note the value for '''Memory Usage'''. Double this value and add another Meg to it. Update the PHP configuration files with this new value for '''apc.shm_size'''

==Additional Information==

Read more about configuration directives at [ <nowiki></nowiki>]

'''''[[#top | Top]]'''''


[[Category: Uniform Server 8-Coral]]

Navigation menu