php - APC Enabled but Apache Still Opening Files? -
I am working on a high-traffic webserver farm, which provides dynamic PHP code, with a maximum of 100 requests on most requests. The files include the API opcode cache enabled, include_once_override is enabled, and I've allocated 64MB rams in the cache, even when I strace an Apache process I still open it () ing and stat () all these covers Which should be included for every request, pull it from the cache I'm going to use is populated cache that I can see in the data cache and 100% Hitred. Can anyone offer any insights?
. According to the APC document:
apc.stat integer
Be careful to change this setting. To trigger this default, APC has been forced to compulsorize the script (check) on every request, whether it has been modified or not. If it has been modified it will recompile and cache the new version. If this setting is off, then the APC will not be checked, which means that in order to force the APC to check the files again, the web server must restart or manually clean the cache. Note that FastCGI Web server can not clean the cache on configuration restart. On the production server where the script changes very rarely, a significant display can be promoted with inefficient performance data.
This option is also applicable for included / required files, but keep in mind that for the relative path (any path that does not start with / on UNIX) Has to be checked for. If you use the full path then APC can leave the state and can use that full path as a unique identifier for the file.
A good rule of thumb for PHP is the complete path to your project like this:
// suppose __FILE__ of your project Define what's in the root ('PATH_PROJECT', the actual path (Dynamic name (__ file__));
then its use is included like this:
include_once PATH_PROJECT '/some/dir/file.php';
In this way you still have the relative path facility, but in reality you are using the full path.
< / Div>